-
-
Notifications
You must be signed in to change notification settings - Fork 282
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add type overloads for async sleep
function
#399
Comments
jakkdl
added a commit
to jakkdl/tenacity
that referenced
this issue
Apr 18, 2023
jakkdl
added a commit
to jakkdl/tenacity
that referenced
this issue
Apr 18, 2023
clrpackages
pushed a commit
to clearlinux-pkgs/pypi-tenacity
that referenced
this issue
Aug 15, 2023
…sion 8.2.3 Felix Yan (1): Fix tests for typeguard 3.x (#394) John Litborn (1): Add support for async sleep functions in tenacity.retry annotation. Fixes jd/tenacity#399 (#400) Julien Danjou (1): chore: remove support for Python 3.6 Kushal Gajurel (1): Added the link to documentation for a better experience (#409)
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The type annotation here
tenacity/tenacity/__init__.py
Lines 500 to 502 in 4333249
should be
t.Callable[[t.Union[int, float]], t.Union[None, t.Awaitable[None]]
, sinceAsyncRetrying
allows asyncsleep
functions.Going further, we could define an additional
AsyncWrappedFn
typevar and propagate that though to ensure that thesleep
callback is always awaitable when retrying for a coroutine function. This is a pretty important performance footgun to avoid!The text was updated successfully, but these errors were encountered: