Improve many __(a)exit__ annotations (#9696)

This commit is contained in:
Avasam
2023-02-25 16:50:30 -05:00
committed by GitHub
parent db821101b8
commit 52ec44fa58
45 changed files with 216 additions and 81 deletions

View File

@@ -1,5 +1,6 @@
from _typeshed import Incomplete
from _typeshed import Incomplete, Unused
from collections.abc import Generator, Sequence
from types import TracebackType
from typing import NamedTuple
from typing_extensions import Self
@@ -16,7 +17,7 @@ class _CallbackResult:
def __bool__(self) -> bool: ...
__nonzero__: Incomplete
def __enter__(self): ...
def __exit__(self, *args, **kwargs) -> None: ...
def __exit__(self, *args: Unused, **kwargs: Unused) -> None: ...
def is_ready(self): ...
@property
def ready(self): ...
@@ -31,7 +32,7 @@ class _CallbackResult:
class _IoloopTimerContext:
def __init__(self, duration, connection) -> None: ...
def __enter__(self): ...
def __exit__(self, *_args, **_kwargs) -> None: ...
def __exit__(self, *_args: Unused, **_kwargs: Unused) -> None: ...
def is_ready(self): ...
class _TimerEvt:
@@ -57,7 +58,9 @@ class BlockingConnection:
self, parameters: Parameters | Sequence[Parameters] | None = ..., _impl_class: Incomplete | None = ...
) -> None: ...
def __enter__(self) -> Self: ...
def __exit__(self, exc_type: object, value: object, traceback: object) -> None: ...
def __exit__(
self, exc_type: type[BaseException] | None, value: BaseException | None, traceback: TracebackType | None
) -> None: ...
def add_on_connection_blocked_callback(self, callback) -> None: ...
def add_on_connection_unblocked_callback(self, callback) -> None: ...
def call_later(self, delay, callback): ...
@@ -160,7 +163,9 @@ class BlockingChannel:
def __init__(self, channel_impl, connection) -> None: ...
def __int__(self) -> int: ...
def __enter__(self): ...
def __exit__(self, exc_type, value, traceback) -> None: ...
def __exit__(
self, exc_type: type[BaseException] | None, value: BaseException | None, traceback: TracebackType | None
) -> None: ...
@property
def channel_number(self): ...
@property