-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
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
false "not async iterable" on use of overload with async iterable #10301
Comments
That's kind of unfortunate. Removing the "async" from the overloads is probably your best solution, see #5385 (comment) for some more context |
Removing the The agreed-upon solution should be clearly documented in the |
Removing the |
i think this is related to this issue code: from abc import ABC, abstractmethod
from typing import Any, AsyncIterator
class MyABC(ABC):
@abstractmethod
async def func(self) -> AsyncIterator[Any]: pass
class MyClass(MyABC):
async def func(self) -> AsyncIterator[Any]:
yield 1 error:
@hauntsaninja as you can see in code example abstract and actual classes have the same
|
They do not have the same type, because Closing because while mypy's behaviour here is surprising, it is correct, and I don't see a better solution here. |
Bug Report
Using typing.overload on an async iterator doesn't behave as I expected:
if I remove
async
qualifier on the overloads, it appears to work. But that doesn't seem right...Expected Behavior
no errors on correct usage
Actual Behavior
error on usage:
Your Environment
The text was updated successfully, but these errors were encountered: