Skip to content

Conversation

@sobolevn
Copy link
Member

Source: https://github.com/python/cpython/blob/187930f74c44e460ba09c60ba5d9bb4fac543d8f/Lib/_collections_abc.py#L206-L240

Why is that important? Because async def is a Coroutine, which is much more than Awaitable. For example, this backfires in #6779

@sobolevnsobolevn mentioned this pull request Feb 2, 2022
@sobolevn
Copy link
MemberAuthor

Ok, types.pyi as well.

@github-actions

This comment has been minimized.

1 similar comment
@github-actions
Copy link
Contributor

Diff from mypy_primer, showing the effect of this PR on open source code:

tornado (https://github.com/tornadoweb/tornado) + tornado/gen.py:429: error: Incompatible return value type (got "WaitIterator", expected "AsyncIterator[Any]")+ tornado/gen.py:429: note: Following member(s) of "WaitIterator" have conflicts:+ tornado/gen.py:429: note: Expected:+ tornado/gen.py:429: note: def __anext__(self) -> Coroutine[Any, Any, Any]+ tornado/gen.py:429: note: Got:+ tornado/gen.py:429: note: def __anext__(self) -> Future[Any]

Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

@sobolevn@srittau