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 @@
import datetime
from _typeshed import Unused
from collections.abc import Callable, Iterator
from json import JSONDecoder
from typing import Any
@@ -107,7 +108,7 @@ class Response:
def __nonzero__(self) -> bool: ...
def __iter__(self) -> Iterator[bytes]: ...
def __enter__(self) -> Self: ...
def __exit__(self, *args: object) -> None: ...
def __exit__(self, *args: Unused) -> None: ...
@property
def next(self) -> PreparedRequest | None: ...
@property

View File

@@ -1,4 +1,4 @@
from _typeshed import Incomplete, SupportsItems, SupportsRead
from _typeshed import Incomplete, SupportsItems, SupportsRead, Unused
from collections.abc import Callable, Iterable, Mapping, MutableMapping
from typing import Any
from typing_extensions import Self, TypeAlias, TypedDict
@@ -134,7 +134,7 @@ class Session(SessionRedirectMixin):
redirect_cache: RecentlyUsedContainer[Any, Any]
def __init__(self) -> None: ...
def __enter__(self) -> Self: ...
def __exit__(self, *args) -> None: ...
def __exit__(self, *args: Unused) -> None: ...
def prepare_request(self, request: Request) -> PreparedRequest: ...
def request(
self,