mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-21 03:11:16 +08:00
switch order of base classes on awaitable classes (#2125)
Fixes #1940. This makes it so that mypy will infer the common base class of these classes to be Awaitable instead of Iterable. I verified that this fixes the errors in the script posted by @neilconway.
This commit is contained in:
committed by
Guido van Rossum
parent
7abcd0f71f
commit
cb293ebd2e
@@ -173,7 +173,7 @@ class Coroutine(Awaitable[_V_co], Generic[_T_co, _T_contra, _V_co]):
|
||||
|
||||
# NOTE: This type does not exist in typing.py or PEP 484.
|
||||
# The parameters corrrespond to Generator, but the 4th is the original type.
|
||||
class AwaitableGenerator(Generator[_T_co, _T_contra, _V_co], Awaitable[_V_co],
|
||||
class AwaitableGenerator(Awaitable[_V_co], Generator[_T_co, _T_contra, _V_co],
|
||||
Generic[_T_co, _T_contra, _V_co, _S]):
|
||||
pass
|
||||
|
||||
|
||||
Reference in New Issue
Block a user