diff --git a/releasenotes/notes/fix-wait-typing-b26eecdb6cc0a1de.yaml b/releasenotes/notes/fix-wait-typing-b26eecdb6cc0a1de.yaml new file mode 100644 index 0000000..3b560c3 --- /dev/null +++ b/releasenotes/notes/fix-wait-typing-b26eecdb6cc0a1de.yaml @@ -0,0 +1,5 @@ +--- +fixes: + - | + Argument `wait` was improperly annotated, making mypy checks fail. + Now it's annotated as `typing.Union[wait_base, typing.Callable[["RetryCallState"], typing.Union[float, int]]]` diff --git a/tenacity/wait.py b/tenacity/wait.py index 7a793b2..e1e2fe4 100644 --- a/tenacity/wait.py +++ b/tenacity/wait.py @@ -41,7 +41,7 @@ def __radd__(self, other: "wait_base") -> typing.Union["wait_combine", "wait_bas return self.__add__(other) -WaitBaseT = typing.Union[wait_base, typing.Callable[["RetryCallState"], bool]] +WaitBaseT = typing.Union[wait_base, typing.Callable[["RetryCallState"], typing.Union[float, int]]] class wait_fixed(wait_base):