Remove many redundant inheritances from Generic[] (#10933)

This commit is contained in:
Alex Waygood
2023-10-26 19:07:20 +01:00
committed by GitHub
parent 5dbdd59c9b
commit a08d4c8d2e
30 changed files with 81 additions and 81 deletions

View File

@@ -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]

View File

@@ -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__(

View File

@@ -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__(

View File

@@ -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__(

View File

@@ -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

View File

@@ -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

View File

@@ -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: ...

View File

@@ -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,