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,4 +1,5 @@
from collections.abc import MutableMapping
from types import TracebackType
from typing import Any, NoReturn, TypeVar
_KT = TypeVar("_KT")
@@ -6,7 +7,9 @@ _VT = TypeVar("_VT")
class RLock:
def __enter__(self): ...
def __exit__(self, exc_type, exc_value, traceback): ...
def __exit__(
self, exc_type: type[BaseException] | None, exc_value: BaseException | None, traceback: TracebackType | None
) -> None: ...
class RecentlyUsedContainer(MutableMapping[_KT, _VT]):
ContainerCls: Any

View File

@@ -1,4 +1,6 @@
from types import TracebackType
from typing import Any
from typing_extensions import Literal
from .request import RequestMethods
@@ -8,7 +10,9 @@ class PoolManager(RequestMethods):
pools: Any
def __init__(self, num_pools=..., headers=..., **connection_pool_kw) -> None: ...
def __enter__(self): ...
def __exit__(self, exc_type, exc_val, exc_tb): ...
def __exit__(
self, exc_type: type[BaseException] | None, exc_val: BaseException | None, exc_tb: TracebackType | None
) -> Literal[False]: ...
def clear(self): ...
def connection_from_host(self, host, port=..., scheme=...): ...
def connection_from_url(self, url): ...