mirror of
https://github.com/davidhalter/typeshed.git
synced 2026-02-24 18:48:46 +08:00
Remove many redundant inheritances from Generic[] (#10933)
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
from _typeshed import Incomplete, SupportsWrite
|
||||
from collections.abc import Awaitable, Callable, Generator, Iterable, Iterator, Mapping
|
||||
from typing import Generic, NoReturn, TypeVar, overload
|
||||
from typing import NoReturn, TypeVar, overload
|
||||
from typing_extensions import Self
|
||||
|
||||
from .std import tqdm as std_tqdm
|
||||
@@ -9,7 +9,7 @@ __all__ = ["tqdm_asyncio", "tarange", "tqdm", "trange"]
|
||||
|
||||
_T = TypeVar("_T")
|
||||
|
||||
class tqdm_asyncio(std_tqdm[_T], Generic[_T]):
|
||||
class tqdm_asyncio(std_tqdm[_T]):
|
||||
iterable_awaitable: bool
|
||||
iterable_next: Callable[[], _T | Awaitable[_T]]
|
||||
iterable_iterator: Iterator[_T]
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
from _typeshed import Incomplete, SupportsWrite
|
||||
from collections.abc import Iterable, Mapping
|
||||
from typing import Generic, NoReturn, TypeVar, overload
|
||||
from typing import NoReturn, TypeVar, overload
|
||||
|
||||
from ..auto import tqdm as tqdm_auto
|
||||
from .utils_worker import MonoWorker
|
||||
@@ -15,7 +15,7 @@ class DiscordIO(MonoWorker):
|
||||
|
||||
_T = TypeVar("_T")
|
||||
|
||||
class tqdm_discord(tqdm_auto[_T], Generic[_T]):
|
||||
class tqdm_discord(tqdm_auto[_T]):
|
||||
dio: Incomplete
|
||||
@overload
|
||||
def __init__(
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
from _typeshed import Incomplete, SupportsWrite
|
||||
from collections.abc import Iterable, Mapping
|
||||
from typing import Generic, NoReturn, TypeVar, overload
|
||||
from typing import NoReturn, TypeVar, overload
|
||||
|
||||
from ..auto import tqdm as tqdm_auto
|
||||
from .utils_worker import MonoWorker
|
||||
@@ -16,7 +16,7 @@ class SlackIO(MonoWorker):
|
||||
|
||||
_T = TypeVar("_T")
|
||||
|
||||
class tqdm_slack(tqdm_auto[_T], Generic[_T]):
|
||||
class tqdm_slack(tqdm_auto[_T]):
|
||||
sio: Incomplete
|
||||
@overload
|
||||
def __init__(
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
from _typeshed import Incomplete, SupportsWrite
|
||||
from collections.abc import Iterable, Mapping
|
||||
from typing import Generic, NoReturn, TypeVar, overload
|
||||
from typing import NoReturn, TypeVar, overload
|
||||
|
||||
from ..auto import tqdm as tqdm_auto
|
||||
from .utils_worker import MonoWorker
|
||||
@@ -21,7 +21,7 @@ class TelegramIO(MonoWorker):
|
||||
|
||||
_T = TypeVar("_T")
|
||||
|
||||
class tqdm_telegram(tqdm_auto[_T], Generic[_T]):
|
||||
class tqdm_telegram(tqdm_auto[_T]):
|
||||
tgio: Incomplete
|
||||
@overload
|
||||
def __init__(
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
from _typeshed import Incomplete, SupportsWrite
|
||||
from collections.abc import Iterable, Mapping
|
||||
from typing import Generic, NoReturn, TypeVar, overload
|
||||
from typing import NoReturn, TypeVar, overload
|
||||
|
||||
from .std import tqdm as std_tqdm
|
||||
|
||||
@@ -8,7 +8,7 @@ __all__ = ["tqdm_gui", "tgrange", "tqdm", "trange"]
|
||||
|
||||
_T = TypeVar("_T")
|
||||
|
||||
class tqdm_gui(std_tqdm[_T], Generic[_T]):
|
||||
class tqdm_gui(std_tqdm[_T]):
|
||||
mpl: Incomplete
|
||||
plt: Incomplete
|
||||
toolbar: Incomplete
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
from _typeshed import Incomplete, SupportsWrite
|
||||
from collections.abc import Iterable, Iterator, Mapping
|
||||
from typing import Generic, NoReturn, TypeVar, overload
|
||||
from typing import NoReturn, TypeVar, overload
|
||||
|
||||
from .std import tqdm as std_tqdm, trange as trange
|
||||
|
||||
@@ -8,7 +8,7 @@ __all__ = ["tqdm_notebook", "tnrange", "tqdm", "trange"]
|
||||
|
||||
_T = TypeVar("_T")
|
||||
|
||||
class tqdm_notebook(std_tqdm[_T], Generic[_T]):
|
||||
class tqdm_notebook(std_tqdm[_T]):
|
||||
@staticmethod
|
||||
def status_printer(
|
||||
_: SupportsWrite[str] | None, total: float | None = None, desc: str | None = None, ncols: int | None = None
|
||||
|
||||
@@ -1,12 +1,14 @@
|
||||
from _typeshed import Incomplete, SupportsWrite
|
||||
from abc import ABC, abstractmethod
|
||||
from collections.abc import Iterable, Mapping
|
||||
from typing import Generic, NoReturn, TypeVar, overload
|
||||
from typing import NoReturn, TypeVar, overload
|
||||
|
||||
from .std import tqdm as std_tqdm
|
||||
|
||||
__all__ = ["tqdm_rich", "trrange", "tqdm", "trange"]
|
||||
|
||||
_T = TypeVar("_T")
|
||||
|
||||
# Actually rich.progress.ProgressColumn
|
||||
class _ProgressColumn(ABC):
|
||||
max_refresh: float | None
|
||||
@@ -31,9 +33,7 @@ class RateColumn(_ProgressColumn):
|
||||
def __init__(self, unit: str = ..., unit_scale: bool = ..., unit_divisor: int = ...) -> None: ...
|
||||
def render(self, task): ...
|
||||
|
||||
_T = TypeVar("_T")
|
||||
|
||||
class tqdm_rich(std_tqdm[_T], Generic[_T]):
|
||||
class tqdm_rich(std_tqdm[_T]):
|
||||
def close(self) -> None: ...
|
||||
def clear(self, *_, **__) -> None: ...
|
||||
def display(self, *_, **__) -> None: ...
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
from _typeshed import Incomplete, SupportsWrite
|
||||
from collections.abc import Iterable, Mapping
|
||||
from typing import Generic, NoReturn, TypeVar, overload
|
||||
from typing import NoReturn, TypeVar, overload
|
||||
|
||||
from .std import tqdm as std_tqdm
|
||||
|
||||
@@ -8,7 +8,7 @@ __all__ = ["tqdm_tk", "ttkrange", "tqdm", "trange"]
|
||||
|
||||
_T = TypeVar("_T")
|
||||
|
||||
class tqdm_tk(std_tqdm[_T], Generic[_T]):
|
||||
class tqdm_tk(std_tqdm[_T]):
|
||||
@overload
|
||||
def __init__(
|
||||
self,
|
||||
|
||||
Reference in New Issue
Block a user