mirror of
https://github.com/davidhalter/typeshed.git
synced 2026-01-23 11:32:07 +08:00
stdlib: Improve a bunch of __(a)exit__ methods (#7571)
This commit is contained in:
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user