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:
@@ -123,7 +123,7 @@ class AbstractServer:
|
||||
def close(self) -> None: ...
|
||||
if sys.version_info >= (3, 7):
|
||||
async def __aenter__(self: Self) -> Self: ...
|
||||
async def __aexit__(self, *exc: Any) -> None: ...
|
||||
async def __aexit__(self, *exc: object) -> None: ...
|
||||
@abstractmethod
|
||||
def get_loop(self) -> AbstractEventLoop: ...
|
||||
@abstractmethod
|
||||
|
||||
@@ -25,7 +25,7 @@ else:
|
||||
class _ContextManager:
|
||||
def __init__(self, lock: Lock | Semaphore) -> None: ...
|
||||
def __enter__(self) -> None: ...
|
||||
def __exit__(self, *args: Any) -> None: ...
|
||||
def __exit__(self, *args: object) -> None: ...
|
||||
|
||||
class _ContextManagerMixin:
|
||||
# Apparently this exists to *prohibit* use as a context manager.
|
||||
|
||||
@@ -31,7 +31,7 @@ if sys.platform == "win32":
|
||||
def __del__(self) -> None: ...
|
||||
|
||||
def __enter__(self: Self) -> Self: ...
|
||||
def __exit__(self, t: type | None, v: BaseException | None, tb: TracebackType | None) -> None: ...
|
||||
def __exit__(self, t: type[BaseException] | None, v: BaseException | None, tb: TracebackType | None) -> None: ...
|
||||
@property
|
||||
def handle(self) -> int: ...
|
||||
def fileno(self) -> int: ...
|
||||
|
||||
Reference in New Issue
Block a user