Skip to content

Commit

Permalink
better wait.WaitBaseT annotation (#392)
Browse files Browse the repository at this point in the history
* better wait.WaitBaseT annotation

fixes #391

* add release notes

* fix release note

---------

Co-authored-by: dmitrii-sorokin-cndt <dmitrii.sorokin@cndt.app>
  • Loading branch information
karech and dmitrii-sorokin-cndt committed Feb 28, 2023
1 parent 3cf1c90 commit 548c5d4
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 5 additions & 0 deletions 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]]]`
2 changes: 1 addition & 1 deletion tenacity/wait.py
Expand Up @@ -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):
Expand Down

0 comments on commit 548c5d4

Please sign in to comment.