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

@@ -17,7 +17,7 @@ class _Callback:
finish: Incomplete | None,
) -> None: ...
def __enter__(self) -> Self: ...
def __exit__(self, *args) -> None: ...
def __exit__(self, *args: object) -> None: ...
def register(self) -> None: ...
def unregister(self) -> None: ...

View File

@@ -1,6 +1,7 @@
import contextlib
from _typeshed import Incomplete, SupportsWrite
from collections.abc import Callable, Iterable, Iterator, Mapping, MutableMapping
from types import TracebackType
from typing import Any, ClassVar, Generic, NoReturn, TypeVar, overload
from typing_extensions import Literal, Self
@@ -200,7 +201,9 @@ class tqdm(Generic[_T], Iterable[_T], Comparable):
def __reversed__(self) -> Iterator[_T]: ...
def __contains__(self, item: object) -> bool: ...
def __enter__(self) -> Self: ...
def __exit__(self, exc_type: object, exc_value: object, traceback: object) -> None: ...
def __exit__(
self, exc_type: type[BaseException] | None, exc_value: BaseException | None, traceback: TracebackType | None
) -> None: ...
def __del__(self) -> None: ...
def __hash__(self) -> int: ...
def __iter__(self) -> Iterator[_T]: ...