Third-party stubs: Improve several __exit__ methods (#7575)

This commit is contained in:
Alex Waygood
2022-04-01 16:03:12 +01:00
committed by GitHub
parent 4c9dc43c87
commit ec27c00ca2
12 changed files with 49 additions and 21 deletions

View File

@@ -1,5 +1,6 @@
from _typeshed import Self
from collections.abc import Callable, Mapping, Sequence
from types import TracebackType
from typing import Any, Generic, TypeVar, overload
from typing_extensions import Literal
@@ -163,7 +164,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: ...
@@ -175,7 +178,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