Remove redundant inheritances from Generic and various typing protocols (#10981)

This commit is contained in:
Alex Waygood
2023-11-06 13:00:25 +00:00
committed by GitHub
parent c8073493fc
commit 8023ba764a
9 changed files with 16 additions and 25 deletions

View File

@@ -56,7 +56,7 @@ class AbstractAsyncContextManager(Protocol[_T_co]):
class ContextDecorator:
def __call__(self, func: _F) -> _F: ...
class _GeneratorContextManager(AbstractContextManager[_T_co], ContextDecorator, Generic[_T_co]):
class _GeneratorContextManager(AbstractContextManager[_T_co], ContextDecorator):
# __init__ and all instance attributes are actually inherited from _GeneratorContextManagerBase
# _GeneratorContextManagerBase is more trouble than it's worth to include in the stub; see #6676
def __init__(self, func: Callable[..., Iterator[_T_co]], args: tuple[Any, ...], kwds: dict[str, Any]) -> None: ...
@@ -81,7 +81,7 @@ if sys.version_info >= (3, 10):
class AsyncContextDecorator:
def __call__(self, func: _AF) -> _AF: ...
class _AsyncGeneratorContextManager(AbstractAsyncContextManager[_T_co], AsyncContextDecorator, Generic[_T_co]):
class _AsyncGeneratorContextManager(AbstractAsyncContextManager[_T_co], AsyncContextDecorator):
# __init__ and these attributes are actually defined in the base class _GeneratorContextManagerBase,
# which is more trouble than it's worth to include in the stub (see #6676)
def __init__(self, func: Callable[..., AsyncIterator[_T_co]], args: tuple[Any, ...], kwds: dict[str, Any]) -> None: ...