Skip to content

Commit

Permalink
fix retry/aioretry decorators type hints
Browse files Browse the repository at this point in the history
  • Loading branch information
Anvil committed Dec 2, 2023
1 parent f6bf78f commit 84c6251
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
### Changes

### Fixes
* fix retry/aioretry decorators type hints

### Breaks

Expand Down
5 changes: 3 additions & 2 deletions kaioretry/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

from typing import cast
from collections.abc import Callable
from mypy_extensions import DefaultNamedArg
from mypy_extensions import DefaultNamedArg, DefaultArg

from .types import Exceptions, NonNegative, Number, Jitter, \
FuncParam, FuncRetVal, UpdateDelayFunc, JitterTuple, AioretryProtocol
Expand Down Expand Up @@ -56,7 +56,8 @@

def _make_decorator(func: Callable[[Retry], Callable[FuncParam, FuncRetVal]]) \
-> Callable[[
Exceptions, int,
DefaultArg(Exceptions, 'exceptions'),
DefaultArg(int, 'tries'),
DefaultNamedArg(NonNegative, 'delay'), # noqa: F821
DefaultNamedArg(Number, 'backoff'), # noqa: F821
DefaultNamedArg(Jitter, 'jitter'), # noqa: F821
Expand Down

0 comments on commit 84c6251

Please sign in to comment.