mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-09 21:46:42 +08:00
Third-party stubs: Improve several __exit__ methods (#7575)
This commit is contained in:
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user