stdlib: Add many missing dunder overrides (#7231)

This commit is contained in:
Alex Waygood
2022-02-16 14:25:47 +00:00
committed by GitHub
parent 409beea616
commit fbc279e3f5
28 changed files with 62 additions and 6 deletions

View File

@@ -46,6 +46,9 @@ class _GeneratorContextManager(AbstractContextManager[_T_co], ContextDecorator,
func: Callable[..., Generator[_T_co, Any, Any]]
args: tuple[Any, ...]
kwds: dict[str, Any]
def __exit__(
self, typ: type[BaseException] | None, value: BaseException | None, traceback: TracebackType | None
) -> bool | None: ...
def contextmanager(func: Callable[_P, Iterator[_T_co]]) -> Callable[_P, _GeneratorContextManager[_T_co]]: ...
@@ -63,6 +66,9 @@ if sys.version_info >= (3, 10):
func: Callable[..., AsyncGenerator[_T_co, Any]]
args: tuple[Any, ...]
kwds: dict[str, Any]
async def __aexit__(
self, typ: type[BaseException] | None, value: BaseException | None, traceback: TracebackType | None
) -> bool | None: ...
elif sys.version_info >= (3, 7):
class _AsyncGeneratorContextManager(AbstractAsyncContextManager[_T_co], Generic[_T_co]):