stdlib: Improve a bunch of __(a)exit__ methods (#7571)

This commit is contained in:
Alex Waygood
2022-04-01 07:05:25 +01:00
committed by GitHub
parent 85f060b26d
commit da3e69d093
20 changed files with 47 additions and 28 deletions

View File

@@ -1,6 +1,7 @@
import sys
from _typeshed import Self
from contextlib import _GeneratorContextManager
from types import TracebackType
from typing import Any, Awaitable, Callable, Generic, Iterable, Mapping, Sequence, TypeVar, overload
from typing_extensions import Literal
@@ -263,7 +264,9 @@ class _patch(Generic[_T]):
temp_original: Any
is_local: bool
def __enter__(self) -> _T: ...
def __exit__(self, *exc_info: Any) -> None: ...
def __exit__(
self, __exc_type: type[BaseException] | None, __exc_value: BaseException | None, __traceback: TracebackType | None
) -> None: ...
def start(self) -> _T: ...
def stop(self) -> None: ...
@@ -275,7 +278,7 @@ class _patch_dict:
def __call__(self, f: Any) -> Any: ...
def decorate_class(self, klass: Any) -> Any: ...
def __enter__(self) -> Any: ...
def __exit__(self, *args: Any) -> Any: ...
def __exit__(self, *args: object) -> Any: ...
start: Any
stop: Any