-
-
Notifications
You must be signed in to change notification settings - Fork 3k
Closed
Labels
bugmypy got something wrongmypy got something wrong
Description
Bug Report
Using typing.overload on an async iterator doesn't behave as I expected:
@overload
async def transitions(self, value: T) -> AsyncIterator[Tuple[T, T]]: ...
@overload
async def transitions(self, predicate: P) -> AsyncIterator[Tuple[T, T]]: ...
async def transitions(self, value_or_predicate):
# impl with yield ...
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:
error: "Coroutine[Any, Any, AsyncIterator[Tuple[str, str]]]" has no attribute "__aiter__" (not async iterable) [attr-defined]
Your Environment
- Mypy version used: .812
- Python version used: 3.7.7
Metadata
Metadata
Assignees
Labels
bugmypy got something wrongmypy got something wrong