You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
AsyncGenerator/AsyncIterable do not work with overloaded async def #14996
When using typing.overload with an async function that returns an AsyncGenerator or AsyncIterable, the overloads fail with Overloaded function implementation cannot produce return type of signature # when defined using async def
no errors when overloads are also defined with async def and error when overloads are defined with def
Actual Behavior
when overloads are defined with async def:
main.py:11: error: Overloaded function implementation cannot produce return type of signature 1 [misc]
main.py:11: error: Overloaded function implementation cannot produce return type of signature 2 [misc]
Found 2 errors in 1 file (checked 1 source file)
Activity
hauntsaninja commentedon Apr 2, 2023
Your success case is expected and is the recommend thing to do. I just added some more documentation for this last week in #14973, see https://mypy.readthedocs.io/en/latest/more_types.html#asynchronous-iterators
Also mention overloads in async iterator documentation
Also mention overloads in async iterator documentation (#14998)