mirror of
https://github.com/davidhalter/typeshed.git
synced 2026-05-22 08:20:21 +08:00
Use typing_extensions.Self instead of _typeshed.Self (#9702)
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
from _typeshed import Incomplete, Self, SupportsWrite
|
||||
from _typeshed import Incomplete, SupportsWrite
|
||||
from collections.abc import Awaitable, Callable, Generator, Iterable, Iterator, Mapping
|
||||
from typing import Generic, NoReturn, TypeVar, overload
|
||||
from typing_extensions import Self
|
||||
|
||||
from .std import tqdm as std_tqdm
|
||||
|
||||
@@ -13,7 +14,7 @@ class tqdm_asyncio(Generic[_T], std_tqdm[_T]):
|
||||
iterable_next: Callable[[], _T | Awaitable[_T]]
|
||||
iterable_iterator: Iterator[_T]
|
||||
|
||||
def __aiter__(self: Self) -> Self: ...
|
||||
def __aiter__(self) -> Self: ...
|
||||
async def __anext__(self) -> Awaitable[_T]: ...
|
||||
def send(self, *args, **kwargs): ...
|
||||
@classmethod
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
from _typeshed import Incomplete, Self
|
||||
from _typeshed import Incomplete
|
||||
from collections.abc import Callable
|
||||
from typing import ClassVar
|
||||
from typing_extensions import Self
|
||||
|
||||
__all__ = ["TqdmCallback"]
|
||||
|
||||
@@ -15,7 +16,7 @@ class _Callback:
|
||||
posttask: Incomplete | None,
|
||||
finish: Incomplete | None,
|
||||
) -> None: ...
|
||||
def __enter__(self: Self) -> Self: ...
|
||||
def __enter__(self) -> Self: ...
|
||||
def __exit__(self, *args) -> None: ...
|
||||
def register(self) -> None: ...
|
||||
def unregister(self) -> None: ...
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
import contextlib
|
||||
from _typeshed import Incomplete, Self, SupportsWrite
|
||||
from _typeshed import Incomplete, SupportsWrite
|
||||
from collections.abc import Callable, Iterable, Iterator, Mapping, MutableMapping
|
||||
from typing import Any, ClassVar, Generic, NoReturn, TypeVar, overload
|
||||
from typing_extensions import Literal
|
||||
from typing_extensions import Literal, Self
|
||||
|
||||
from ._monitor import TMonitor
|
||||
from .utils import Comparable
|
||||
@@ -121,7 +121,7 @@ class tqdm(Generic[_T], Iterable[_T], Comparable):
|
||||
gui: bool = ...,
|
||||
**kwargs,
|
||||
) -> None: ...
|
||||
def __new__(cls: type[Self], *_, **__) -> Self: ...
|
||||
def __new__(cls, *_, **__) -> Self: ...
|
||||
@classmethod
|
||||
def write(cls, s: str, file: SupportsWrite[str] | None = ..., end: str = ..., nolock: bool = ...) -> None: ...
|
||||
@classmethod
|
||||
@@ -199,7 +199,7 @@ class tqdm(Generic[_T], Iterable[_T], Comparable):
|
||||
def __len__(self) -> int: ...
|
||||
def __reversed__(self) -> Iterator[_T]: ...
|
||||
def __contains__(self, item: object) -> bool: ...
|
||||
def __enter__(self: Self) -> Self: ...
|
||||
def __enter__(self) -> Self: ...
|
||||
def __exit__(self, exc_type: object, exc_value: object, traceback: object) -> None: ...
|
||||
def __del__(self) -> None: ...
|
||||
def __hash__(self) -> int: ...
|
||||
|
||||
Reference in New Issue
Block a user