-
-
Notifications
You must be signed in to change notification settings - Fork 306
Closed
Description
Since tenacity 9.1.3, the following program (reduced from real code) fails to type-check:
import asyncio
import tenacity
async def _tenacity_sleep(delay: float) -> None:
await asyncio.sleep(delay)
@tenacity.retry(sleep=_tenacity_sleep)
async def do_wait_for_messages() -> None:
pass$ mypy --strict t.py
t.py:10: error: Argument 1 has incompatible type "Callable[[], Coroutine[Any, Any, None]]"; expected "Callable[[], Awaitable[Never]]" [arg-type]
Found 1 error in 1 file (checked 1 source file)The corresponding sync variant still type-checks fine.
I assume this has something to do with the new return type annotation in the async overload variant introduced by #551, but I haven't quite been able to puzzle it out. Maybe @Zac-HD can help, since this was their change?
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels