mirror of
https://github.com/davidhalter/typeshed.git
synced 2026-07-19 22:50:29 +08:00
Make (Async)GeneratorType type parameters consistent with (Async)Generator type parameters (#14789)
Currently `Generator` is generic over three type variables that have defaults, but `GeneratorType` is generic over three type variables that do not have defaults. It seems like it probably makes more sense for them to be consistent? The vast majority of real-world `Generator`s are instances of `GeneratorType`
This commit is contained in:
+1
-1
@@ -577,7 +577,7 @@ class Awaitable(Protocol[_T_co]):
|
||||
@abstractmethod
|
||||
def __await__(self) -> Generator[Any, Any, _T_co]: ...
|
||||
|
||||
# Non-default variations to accommodate couroutines, and `AwaitableGenerator` having a 4th type parameter.
|
||||
# Non-default variations to accommodate coroutines, and `AwaitableGenerator` having a 4th type parameter.
|
||||
_SendT_nd_contra = TypeVar("_SendT_nd_contra", contravariant=True)
|
||||
_ReturnT_nd_co = TypeVar("_ReturnT_nd_co", covariant=True)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user