mirror of
https://github.com/davidhalter/typeshed.git
synced 2026-02-20 00:28:28 +08:00
Improve many __(a)exit__ annotations (#9696)
This commit is contained in:
@@ -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: ...
|
||||
|
||||
|
||||
@@ -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]: ...
|
||||
|
||||
Reference in New Issue
Block a user