diff --git a/stdlib/_collections_abc.pyi b/stdlib/_collections_abc.pyi index 2b57f157a..8520e9e4e 100644 --- a/stdlib/_collections_abc.pyi +++ b/stdlib/_collections_abc.pyi @@ -81,7 +81,7 @@ class dict_values(ValuesView[_VT_co], Generic[_KT_co, _VT_co]): # undocumented def mapping(self) -> MappingProxyType[_KT_co, _VT_co]: ... @final -class dict_items(ItemsView[_KT_co, _VT_co], Generic[_KT_co, _VT_co]): # undocumented +class dict_items(ItemsView[_KT_co, _VT_co]): # undocumented def __eq__(self, __value: object) -> bool: ... if sys.version_info >= (3, 10): @property diff --git a/stdlib/_weakrefset.pyi b/stdlib/_weakrefset.pyi index d73d79155..6482ade12 100644 --- a/stdlib/_weakrefset.pyi +++ b/stdlib/_weakrefset.pyi @@ -1,6 +1,6 @@ import sys from collections.abc import Iterable, Iterator, MutableSet -from typing import Any, Generic, TypeVar, overload +from typing import Any, TypeVar, overload from typing_extensions import Self if sys.version_info >= (3, 9): @@ -11,7 +11,7 @@ __all__ = ["WeakSet"] _S = TypeVar("_S") _T = TypeVar("_T") -class WeakSet(MutableSet[_T], Generic[_T]): +class WeakSet(MutableSet[_T]): @overload def __init__(self, data: None = None) -> None: ... @overload diff --git a/stdlib/array.pyi b/stdlib/array.pyi index b533f9240..2ef821fcf 100644 --- a/stdlib/array.pyi +++ b/stdlib/array.pyi @@ -3,7 +3,7 @@ from _typeshed import ReadableBuffer, SupportsRead, SupportsWrite from collections.abc import Iterable # pytype crashes if array inherits from collections.abc.MutableSequence instead of typing.MutableSequence -from typing import Any, Generic, MutableSequence, TypeVar, overload # noqa: Y022 +from typing import Any, MutableSequence, TypeVar, overload # noqa: Y022 from typing_extensions import Literal, Self, SupportsIndex, TypeAlias if sys.version_info >= (3, 12): @@ -18,7 +18,7 @@ _T = TypeVar("_T", int, float, str) typecodes: str -class array(MutableSequence[_T], Generic[_T]): +class array(MutableSequence[_T]): @property def typecode(self) -> _TypeCode: ... @property diff --git a/stdlib/asyncio/tasks.pyi b/stdlib/asyncio/tasks.pyi index 366ac7fa3..cdac7d359 100644 --- a/stdlib/asyncio/tasks.pyi +++ b/stdlib/asyncio/tasks.pyi @@ -2,7 +2,7 @@ import concurrent.futures import sys from collections.abc import Awaitable, Coroutine, Generator, Iterable, Iterator from types import FrameType -from typing import Any, Generic, Protocol, TextIO, TypeVar, overload +from typing import Any, Protocol, TextIO, TypeVar, overload from typing_extensions import Literal, TypeAlias from . import _CoroutineLike @@ -379,7 +379,7 @@ else: # While this is true in general, here it's sort-of okay to have a covariant subclass, # since the only reason why `asyncio.Future` is invariant is the `set_result()` method, # and `asyncio.Task.set_result()` always raises. -class Task(Future[_T_co], Generic[_T_co]): # type: ignore[type-var] # pyright: ignore[reportGeneralTypeIssues] +class Task(Future[_T_co]): # type: ignore[type-var] # pyright: ignore[reportGeneralTypeIssues] if sys.version_info >= (3, 12): def __init__( self, diff --git a/stdlib/builtins.pyi b/stdlib/builtins.pyi index 9dbbc91b7..b3253aa4b 100644 --- a/stdlib/builtins.pyi +++ b/stdlib/builtins.pyi @@ -953,7 +953,7 @@ class slice: __hash__: ClassVar[None] # type: ignore[assignment] def indices(self, __len: SupportsIndex) -> tuple[int, int, int]: ... -class tuple(Sequence[_T_co], Generic[_T_co]): +class tuple(Sequence[_T_co]): def __new__(cls, __iterable: Iterable[_T_co] = ...) -> Self: ... def __len__(self) -> int: ... def __contains__(self, __key: object) -> bool: ... @@ -1005,7 +1005,7 @@ class function: # mypy uses `builtins.function.__get__` to represent methods, properties, and getset_descriptors so we type the return as Any. def __get__(self, __instance: object, __owner: type | None = None) -> Any: ... -class list(MutableSequence[_T], Generic[_T]): +class list(MutableSequence[_T]): @overload def __init__(self) -> None: ... @overload @@ -1060,7 +1060,7 @@ class list(MutableSequence[_T], Generic[_T]): if sys.version_info >= (3, 9): def __class_getitem__(cls, __item: Any) -> GenericAlias: ... -class dict(MutableMapping[_KT, _VT], Generic[_KT, _VT]): +class dict(MutableMapping[_KT, _VT]): # __init__ should be kept roughly in line with `collections.UserDict.__init__`, which has similar semantics # Also multiprocessing.managers.SyncManager.dict() @overload @@ -1133,7 +1133,7 @@ class dict(MutableMapping[_KT, _VT], Generic[_KT, _VT]): @overload def __ior__(self, __value: Iterable[tuple[_KT, _VT]]) -> Self: ... -class set(MutableSet[_T], Generic[_T]): +class set(MutableSet[_T]): @overload def __init__(self) -> None: ... @overload @@ -1173,7 +1173,7 @@ class set(MutableSet[_T], Generic[_T]): if sys.version_info >= (3, 9): def __class_getitem__(cls, __item: Any) -> GenericAlias: ... -class frozenset(AbstractSet[_T_co], Generic[_T_co]): +class frozenset(AbstractSet[_T_co]): @overload def __new__(cls) -> Self: ... @overload @@ -1202,7 +1202,7 @@ class frozenset(AbstractSet[_T_co], Generic[_T_co]): if sys.version_info >= (3, 9): def __class_getitem__(cls, __item: Any) -> GenericAlias: ... -class enumerate(Iterator[tuple[int, _T]], Generic[_T]): +class enumerate(Iterator[tuple[int, _T]]): def __new__(cls, iterable: Iterable[_T], start: int = ...) -> Self: ... def __iter__(self) -> Self: ... def __next__(self) -> tuple[int, _T]: ... @@ -1411,7 +1411,7 @@ else: def exit(code: sys._ExitCode = None) -> NoReturn: ... -class filter(Iterator[_T], Generic[_T]): +class filter(Iterator[_T]): @overload def __new__(cls, __function: None, __iterable: Iterable[_T | None]) -> Self: ... @overload @@ -1470,7 +1470,7 @@ def len(__obj: Sized) -> int: ... def license() -> None: ... def locals() -> dict[str, Any]: ... -class map(Iterator[_S], Generic[_S]): +class map(Iterator[_S]): @overload def __new__(cls, __func: Callable[[_T1], _S], __iter1: Iterable[_T1]) -> Self: ... @overload @@ -1742,7 +1742,7 @@ else: def quit(code: sys._ExitCode = None) -> NoReturn: ... -class reversed(Iterator[_T], Generic[_T]): +class reversed(Iterator[_T]): @overload def __init__(self, __sequence: Reversible[_T]) -> None: ... @overload @@ -1816,7 +1816,7 @@ def vars(__object: type) -> types.MappingProxyType[str, Any]: ... # type: ignor @overload def vars(__object: Any = ...) -> dict[str, Any]: ... -class zip(Iterator[_T_co], Generic[_T_co]): +class zip(Iterator[_T_co]): if sys.version_info >= (3, 10): @overload def __new__(cls, *, strict: bool = ...) -> zip[Any]: ... diff --git a/stdlib/collections/__init__.pyi b/stdlib/collections/__init__.pyi index 1d560117a..bb214b5ea 100644 --- a/stdlib/collections/__init__.pyi +++ b/stdlib/collections/__init__.pyi @@ -45,7 +45,7 @@ def namedtuple( defaults: Iterable[Any] | None = None, ) -> type[tuple[Any, ...]]: ... -class UserDict(MutableMapping[_KT, _VT], Generic[_KT, _VT]): +class UserDict(MutableMapping[_KT, _VT]): data: dict[_KT, _VT] # __init__ should be kept roughly in line with `dict.__init__`, which has the same semantics @overload @@ -228,7 +228,7 @@ class UserString(Sequence[UserString]): def upper(self) -> Self: ... def zfill(self, width: int) -> Self: ... -class deque(MutableSequence[_T], Generic[_T]): +class deque(MutableSequence[_T]): @property def maxlen(self) -> int | None: ... @overload @@ -383,7 +383,7 @@ class OrderedDict(dict[_KT, _VT], Reversible[_KT], Generic[_KT, _VT]): @overload def __ror__(self, __value: dict[_T1, _T2]) -> OrderedDict[_KT | _T1, _VT | _T2]: ... # type: ignore[misc] -class defaultdict(dict[_KT, _VT], Generic[_KT, _VT]): +class defaultdict(dict[_KT, _VT]): default_factory: Callable[[], _VT] | None @overload def __init__(self) -> None: ... @@ -424,7 +424,7 @@ class defaultdict(dict[_KT, _VT], Generic[_KT, _VT]): @overload def __ror__(self, __value: dict[_T1, _T2]) -> defaultdict[_KT | _T1, _VT | _T2]: ... # type: ignore[misc] -class ChainMap(MutableMapping[_KT, _VT], Generic[_KT, _VT]): +class ChainMap(MutableMapping[_KT, _VT]): maps: list[MutableMapping[_KT, _VT]] def __init__(self, *maps: MutableMapping[_KT, _VT]) -> None: ... def new_child(self, m: MutableMapping[_KT, _VT] | None = None) -> Self: ... diff --git a/stdlib/contextlib.pyi b/stdlib/contextlib.pyi index dc2101dc0..c1bfedd2d 100644 --- a/stdlib/contextlib.pyi +++ b/stdlib/contextlib.pyi @@ -94,7 +94,7 @@ if sys.version_info >= (3, 10): ) -> bool | None: ... else: - class _AsyncGeneratorContextManager(AbstractAsyncContextManager[_T_co], Generic[_T_co]): + class _AsyncGeneratorContextManager(AbstractAsyncContextManager[_T_co]): def __init__(self, func: Callable[..., AsyncIterator[_T_co]], args: tuple[Any, ...], kwds: dict[str, Any]) -> None: ... gen: AsyncGenerator[_T_co, Any] func: Callable[..., AsyncGenerator[_T_co, Any]] diff --git a/stdlib/fileinput.pyi b/stdlib/fileinput.pyi index e9f3713b4..c2fd31d1e 100644 --- a/stdlib/fileinput.pyi +++ b/stdlib/fileinput.pyi @@ -2,7 +2,7 @@ import sys from _typeshed import AnyStr_co, StrOrBytesPath from collections.abc import Callable, Iterable, Iterator from types import TracebackType -from typing import IO, Any, AnyStr, Generic, Protocol, overload +from typing import IO, Any, AnyStr, Protocol, overload from typing_extensions import Literal, Self, TypeAlias if sys.version_info >= (3, 9): @@ -158,7 +158,7 @@ def fileno() -> int: ... def isfirstline() -> bool: ... def isstdin() -> bool: ... -class FileInput(Iterator[AnyStr], Generic[AnyStr]): +class FileInput(Iterator[AnyStr]): if sys.version_info >= (3, 10): # encoding and errors are added @overload diff --git a/stdlib/itertools.pyi b/stdlib/itertools.pyi index 4b5d624c7..ffa8e1939 100644 --- a/stdlib/itertools.pyi +++ b/stdlib/itertools.pyi @@ -23,7 +23,7 @@ _Predicate: TypeAlias = Callable[[_T], object] # Technically count can take anything that implements a number protocol and has an add method # but we can't enforce the add method -class count(Iterator[_N], Generic[_N]): +class count(Iterator[_N]): @overload def __new__(cls) -> count[int]: ... @overload @@ -33,12 +33,12 @@ class count(Iterator[_N], Generic[_N]): def __next__(self) -> _N: ... def __iter__(self) -> Self: ... -class cycle(Iterator[_T], Generic[_T]): +class cycle(Iterator[_T]): def __init__(self, __iterable: Iterable[_T]) -> None: ... def __next__(self) -> _T: ... def __iter__(self) -> Self: ... -class repeat(Iterator[_T], Generic[_T]): +class repeat(Iterator[_T]): @overload def __init__(self, object: _T) -> None: ... @overload @@ -47,7 +47,7 @@ class repeat(Iterator[_T], Generic[_T]): def __iter__(self) -> Self: ... def __length_hint__(self) -> int: ... -class accumulate(Iterator[_T], Generic[_T]): +class accumulate(Iterator[_T]): if sys.version_info >= (3, 8): @overload def __init__(self, iterable: Iterable[_T], func: None = None, *, initial: _T | None = ...) -> None: ... @@ -59,7 +59,7 @@ class accumulate(Iterator[_T], Generic[_T]): def __iter__(self) -> Self: ... def __next__(self) -> _T: ... -class chain(Iterator[_T], Generic[_T]): +class chain(Iterator[_T]): def __init__(self, *iterables: Iterable[_T]) -> None: ... def __next__(self) -> _T: ... def __iter__(self) -> Self: ... @@ -69,17 +69,17 @@ class chain(Iterator[_T], Generic[_T]): if sys.version_info >= (3, 9): def __class_getitem__(cls, __item: Any) -> GenericAlias: ... -class compress(Iterator[_T], Generic[_T]): +class compress(Iterator[_T]): def __init__(self, data: Iterable[_T], selectors: Iterable[Any]) -> None: ... def __iter__(self) -> Self: ... def __next__(self) -> _T: ... -class dropwhile(Iterator[_T], Generic[_T]): +class dropwhile(Iterator[_T]): def __init__(self, __predicate: _Predicate[_T], __iterable: Iterable[_T]) -> None: ... def __iter__(self) -> Self: ... def __next__(self) -> _T: ... -class filterfalse(Iterator[_T], Generic[_T]): +class filterfalse(Iterator[_T]): def __init__(self, __predicate: _Predicate[_T] | None, __iterable: Iterable[_T]) -> None: ... def __iter__(self) -> Self: ... def __next__(self) -> _T: ... @@ -92,7 +92,7 @@ class groupby(Iterator[tuple[_T, Iterator[_S]]], Generic[_T, _S]): def __iter__(self) -> Self: ... def __next__(self) -> tuple[_T, Iterator[_S]]: ... -class islice(Iterator[_T], Generic[_T]): +class islice(Iterator[_T]): @overload def __init__(self, __iterable: Iterable[_T], __stop: int | None) -> None: ... @overload @@ -100,19 +100,19 @@ class islice(Iterator[_T], Generic[_T]): def __iter__(self) -> Self: ... def __next__(self) -> _T: ... -class starmap(Iterator[_T], Generic[_T]): +class starmap(Iterator[_T]): def __init__(self, __function: Callable[..., _T], __iterable: Iterable[Iterable[Any]]) -> None: ... def __iter__(self) -> Self: ... def __next__(self) -> _T: ... -class takewhile(Iterator[_T], Generic[_T]): +class takewhile(Iterator[_T]): def __init__(self, __predicate: _Predicate[_T], __iterable: Iterable[_T]) -> None: ... def __iter__(self) -> Self: ... def __next__(self) -> _T: ... def tee(__iterable: Iterable[_T], __n: int = 2) -> tuple[Iterator[_T], ...]: ... -class zip_longest(Iterator[_T_co], Generic[_T_co]): +class zip_longest(Iterator[_T_co]): # one iterable (fillvalue doesn't matter) @overload def __new__(cls, __iter1: Iterable[_T1], *, fillvalue: object = ...) -> zip_longest[tuple[_T1]]: ... @@ -192,7 +192,7 @@ class zip_longest(Iterator[_T_co], Generic[_T_co]): def __iter__(self) -> Self: ... def __next__(self) -> _T_co: ... -class product(Iterator[_T_co], Generic[_T_co]): +class product(Iterator[_T_co]): @overload def __new__(cls, __iter1: Iterable[_T1]) -> product[tuple[_T1]]: ... @overload @@ -246,7 +246,7 @@ class permutations(Iterator[tuple[_T, ...]], Generic[_T]): def __iter__(self) -> Self: ... def __next__(self) -> tuple[_T, ...]: ... -class combinations(Iterator[_T_co], Generic[_T_co]): +class combinations(Iterator[_T_co]): @overload def __new__(cls, iterable: Iterable[_T], r: Literal[2]) -> combinations[tuple[_T, _T]]: ... @overload @@ -266,7 +266,7 @@ class combinations_with_replacement(Iterator[tuple[_T, ...]], Generic[_T]): def __next__(self) -> tuple[_T, ...]: ... if sys.version_info >= (3, 10): - class pairwise(Iterator[_T_co], Generic[_T_co]): + class pairwise(Iterator[_T_co]): def __new__(cls, __iterable: Iterable[_T]) -> pairwise[tuple[_T, _T]]: ... def __iter__(self) -> Self: ... def __next__(self) -> _T_co: ... diff --git a/stdlib/tempfile.pyi b/stdlib/tempfile.pyi index 61bcde242..f8dcb24c1 100644 --- a/stdlib/tempfile.pyi +++ b/stdlib/tempfile.pyi @@ -321,7 +321,7 @@ else: dir: GenericPath[AnyStr] | None = None, ) -> IO[Any]: ... -class _TemporaryFileWrapper(IO[AnyStr], Generic[AnyStr]): +class _TemporaryFileWrapper(IO[AnyStr]): file: IO[AnyStr] # io.TextIOWrapper, io.BufferedReader or io.BufferedWriter name: str delete: bool diff --git a/stdlib/types.pyi b/stdlib/types.pyi index 855906383..a50bbf145 100644 --- a/stdlib/types.pyi +++ b/stdlib/types.pyi @@ -16,7 +16,7 @@ from collections.abc import ( from importlib.machinery import ModuleSpec # pytype crashes if types.MappingProxyType inherits from collections.abc.Mapping instead of typing.Mapping -from typing import Any, ClassVar, Generic, Mapping, Protocol, TypeVar, overload # noqa: Y022 +from typing import Any, ClassVar, Mapping, Protocol, TypeVar, overload # noqa: Y022 from typing_extensions import Literal, ParamSpec, Self, TypeVarTuple, final __all__ = [ @@ -309,7 +309,7 @@ class CodeType: ) -> CodeType: ... @final -class MappingProxyType(Mapping[_KT, _VT_co], Generic[_KT, _VT_co]): +class MappingProxyType(Mapping[_KT, _VT_co]): __hash__: ClassVar[None] # type: ignore[assignment] def __new__(cls, mapping: SupportsKeysAndGetItem[_KT, _VT_co]) -> Self: ... def __getitem__(self, __key: _KT) -> _VT_co: ... diff --git a/stdlib/typing.pyi b/stdlib/typing.pyi index 6deb0ffd0..ad5719ca9 100644 --- a/stdlib/typing.pyi +++ b/stdlib/typing.pyi @@ -527,7 +527,7 @@ class Sequence(Collection[_T_co], Reversible[_T_co], Generic[_T_co]): def __iter__(self) -> Iterator[_T_co]: ... def __reversed__(self) -> Iterator[_T_co]: ... -class MutableSequence(Sequence[_T], Generic[_T]): +class MutableSequence(Sequence[_T]): @abstractmethod def insert(self, index: int, value: _T) -> None: ... @overload @@ -557,7 +557,7 @@ class MutableSequence(Sequence[_T], Generic[_T]): def remove(self, value: _T) -> None: ... def __iadd__(self, values: Iterable[_T]) -> typing_extensions.Self: ... -class AbstractSet(Collection[_T_co], Generic[_T_co]): +class AbstractSet(Collection[_T_co]): @abstractmethod def __contains__(self, x: object) -> bool: ... def _hash(self) -> int: ... @@ -573,7 +573,7 @@ class AbstractSet(Collection[_T_co], Generic[_T_co]): def __eq__(self, other: object) -> bool: ... def isdisjoint(self, other: Iterable[Any]) -> bool: ... -class MutableSet(AbstractSet[_T], Generic[_T]): +class MutableSet(AbstractSet[_T]): @abstractmethod def add(self, value: _T) -> None: ... @abstractmethod @@ -646,7 +646,7 @@ class Mapping(Collection[_KT], Generic[_KT, _VT_co]): def __contains__(self, __key: object) -> bool: ... def __eq__(self, __other: object) -> bool: ... -class MutableMapping(Mapping[_KT, _VT], Generic[_KT, _VT]): +class MutableMapping(Mapping[_KT, _VT]): @abstractmethod def __setitem__(self, __key: _KT, __value: _VT) -> None: ... @abstractmethod @@ -703,7 +703,7 @@ TYPE_CHECKING: bool # In stubs, the arguments of the IO class are marked as positional-only. # This differs from runtime, but better reflects the fact that in reality # classes deriving from IO use different names for the arguments. -class IO(Iterator[AnyStr], Generic[AnyStr]): +class IO(Iterator[AnyStr]): # At runtime these are all abstract properties, # but making them abstract in the stub is hugely disruptive, for not much gain. # See #8726 diff --git a/stdlib/weakref.pyi b/stdlib/weakref.pyi index ca5366602..ae88f3a31 100644 --- a/stdlib/weakref.pyi +++ b/stdlib/weakref.pyi @@ -40,7 +40,7 @@ _P = ParamSpec("_P") ProxyTypes: tuple[type[Any], ...] -class WeakMethod(ref[_CallableT], Generic[_CallableT]): +class WeakMethod(ref[_CallableT]): def __new__(cls, meth: _CallableT, callback: Callable[[Self], object] | None = None) -> Self: ... def __call__(self) -> _CallableT | None: ... def __eq__(self, other: object) -> bool: ... diff --git a/stubs/beautifulsoup4/bs4/element.pyi b/stubs/beautifulsoup4/bs4/element.pyi index aa1e01015..94d13a11f 100644 --- a/stubs/beautifulsoup4/bs4/element.pyi +++ b/stubs/beautifulsoup4/bs4/element.pyi @@ -1,7 +1,7 @@ from _typeshed import Incomplete, ReadableBuffer from collections.abc import Callable, Iterable, Iterator from re import Pattern -from typing import Any, Generic, TypeVar, overload +from typing import Any, TypeVar, overload from typing_extensions import Self, TypeAlias from . import BeautifulSoup @@ -372,7 +372,7 @@ class SoupStrainer: searchTag = search_tag def search(self, markup: PageElement | Iterable[PageElement]): ... -class ResultSet(list[_PageElementT], Generic[_PageElementT]): +class ResultSet(list[_PageElementT]): source: SoupStrainer @overload def __init__(self, source: SoupStrainer) -> None: ... diff --git a/stubs/cachetools/cachetools/__init__.pyi b/stubs/cachetools/cachetools/__init__.pyi index 5cac854c8..3513d7664 100644 --- a/stubs/cachetools/cachetools/__init__.pyi +++ b/stubs/cachetools/cachetools/__init__.pyi @@ -1,7 +1,7 @@ from _typeshed import IdentityFunction, Unused from collections.abc import Callable, Iterator, MutableMapping, Sequence from contextlib import AbstractContextManager -from typing import Any, Generic, TypeVar, overload +from typing import Any, TypeVar, overload __all__ = ("Cache", "FIFOCache", "LFUCache", "LRUCache", "MRUCache", "RRCache", "TLRUCache", "TTLCache", "cached", "cachedmethod") __version__: str @@ -10,7 +10,7 @@ _KT = TypeVar("_KT") _VT = TypeVar("_VT") _T = TypeVar("_T") -class Cache(MutableMapping[_KT, _VT], Generic[_KT, _VT]): +class Cache(MutableMapping[_KT, _VT]): @overload def __init__(self, maxsize: float, getsizeof: Callable[[_VT], float]) -> None: ... @overload diff --git a/stubs/fpdf2/fpdf/syntax.pyi b/stubs/fpdf2/fpdf/syntax.pyi index 3671c05ae..e2ca70cdd 100644 --- a/stubs/fpdf2/fpdf/syntax.pyi +++ b/stubs/fpdf2/fpdf/syntax.pyi @@ -2,7 +2,7 @@ import datetime from _typeshed import Incomplete, SupportsItems from abc import ABC, abstractmethod from re import Pattern -from typing import ClassVar, Generic, TypeVar +from typing import ClassVar, TypeVar from typing_extensions import Literal, Self from .encryption import StandardSecurityHandler @@ -62,7 +62,7 @@ class PDFDate: def __init__(self, date: datetime.datetime, with_tz: bool = False, encrypt: bool = False) -> None: ... def serialize(self) -> str: ... -class PDFArray(list[_T], Generic[_T]): +class PDFArray(list[_T]): def serialize(self) -> str: ... class Destination(ABC): diff --git a/stubs/humanfriendly/humanfriendly/case.pyi b/stubs/humanfriendly/humanfriendly/case.pyi index 4240cf2ab..d54838f75 100644 --- a/stubs/humanfriendly/humanfriendly/case.pyi +++ b/stubs/humanfriendly/humanfriendly/case.pyi @@ -1,13 +1,13 @@ from _typeshed import Incomplete from collections import OrderedDict -from typing import Generic, TypeVar +from typing import TypeVar from humanfriendly.compat import unicode _KT = TypeVar("_KT") _VT = TypeVar("_VT") -class CaseInsensitiveDict(OrderedDict[_KT, _VT], Generic[_KT, _VT]): +class CaseInsensitiveDict(OrderedDict[_KT, _VT]): def __init__(self, other: Incomplete | None = None, **kw) -> None: ... def coerce_key(self, key): ... @classmethod diff --git a/stubs/ldap3/ldap3/utils/ciDict.pyi b/stubs/ldap3/ldap3/utils/ciDict.pyi index 828dcece0..333dac598 100644 --- a/stubs/ldap3/ldap3/utils/ciDict.pyi +++ b/stubs/ldap3/ldap3/utils/ciDict.pyi @@ -1,11 +1,11 @@ from _typeshed import Incomplete from collections.abc import MutableMapping -from typing import Generic, TypeVar +from typing import TypeVar _KT = TypeVar("_KT") _VT = TypeVar("_VT") -class CaseInsensitiveDict(MutableMapping[_KT, _VT], Generic[_KT, _VT]): +class CaseInsensitiveDict(MutableMapping[_KT, _VT]): def __init__(self, other: Incomplete | None = None, **kwargs) -> None: ... def __contains__(self, item): ... def __delitem__(self, key) -> None: ... @@ -19,7 +19,7 @@ class CaseInsensitiveDict(MutableMapping[_KT, _VT], Generic[_KT, _VT]): def __eq__(self, other): ... def copy(self): ... -class CaseInsensitiveWithAliasDict(CaseInsensitiveDict[_KT, _VT], Generic[_KT, _VT]): +class CaseInsensitiveWithAliasDict(CaseInsensitiveDict[_KT, _VT]): def __init__(self, other: Incomplete | None = None, **kwargs) -> None: ... def aliases(self): ... def __setitem__(self, key, value) -> None: ... diff --git a/stubs/redis/redis/asyncio/client.pyi b/stubs/redis/redis/asyncio/client.pyi index 641967905..e58f75d2b 100644 --- a/stubs/redis/redis/asyncio/client.pyi +++ b/stubs/redis/redis/asyncio/client.pyi @@ -289,7 +289,7 @@ PSWorkerThreadExcHandlerT: TypeAlias = PubsubWorkerExceptionHandler | AsyncPubsu CommandT: TypeAlias = tuple[tuple[str | bytes, ...], Mapping[str, Any]] CommandStackT: TypeAlias = list[CommandT] -class Pipeline(Redis[_StrType], Generic[_StrType]): +class Pipeline(Redis[_StrType]): UNWATCH_COMMANDS: ClassVar[set[str]] connection_pool: Any connection: Any diff --git a/stubs/redis/redis/client.pyi b/stubs/redis/redis/client.pyi index b8079fa3d..5c2e4a1ac 100644 --- a/stubs/redis/redis/client.pyi +++ b/stubs/redis/redis/client.pyi @@ -382,7 +382,7 @@ class PubSubWorkerThread(threading.Thread): def run(self) -> None: ... def stop(self) -> None: ... -class Pipeline(Redis[_StrType], Generic[_StrType]): +class Pipeline(Redis[_StrType]): UNWATCH_COMMANDS: Any connection_pool: Any connection: Any diff --git a/stubs/redis/redis/cluster.pyi b/stubs/redis/redis/cluster.pyi index ba515942a..7cca70103 100644 --- a/stubs/redis/redis/cluster.pyi +++ b/stubs/redis/redis/cluster.pyi @@ -188,7 +188,7 @@ class ClusterPubSub(PubSub): def execute_command(self, *args, **kwargs) -> None: ... def get_redis_connection(self) -> Redis[Any] | None: ... -class ClusterPipeline(RedisCluster[_StrType], Generic[_StrType]): +class ClusterPipeline(RedisCluster[_StrType]): command_stack: list[Incomplete] nodes_manager: Incomplete refresh_table_asap: bool diff --git a/stubs/redis/redis/commands/cluster.pyi b/stubs/redis/redis/commands/cluster.pyi index 28789988b..a6b329e9f 100644 --- a/stubs/redis/redis/commands/cluster.pyi +++ b/stubs/redis/redis/commands/cluster.pyi @@ -16,7 +16,7 @@ class ClusterManagementCommands(ManagementCommands): def replicaof(self, *args, **kwargs) -> None: ... def swapdb(self, *args, **kwargs) -> None: ... -class ClusterDataAccessCommands(DataAccessCommands[_StrType], Generic[_StrType]): +class ClusterDataAccessCommands(DataAccessCommands[_StrType]): def stralgo( self, algo, diff --git a/stubs/tqdm/tqdm/asyncio.pyi b/stubs/tqdm/tqdm/asyncio.pyi index 3f9558419..bef9dc177 100644 --- a/stubs/tqdm/tqdm/asyncio.pyi +++ b/stubs/tqdm/tqdm/asyncio.pyi @@ -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] diff --git a/stubs/tqdm/tqdm/contrib/discord.pyi b/stubs/tqdm/tqdm/contrib/discord.pyi index 9ab90e8b8..638683940 100644 --- a/stubs/tqdm/tqdm/contrib/discord.pyi +++ b/stubs/tqdm/tqdm/contrib/discord.pyi @@ -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__( diff --git a/stubs/tqdm/tqdm/contrib/slack.pyi b/stubs/tqdm/tqdm/contrib/slack.pyi index 97b3a3f6d..bcf98f326 100644 --- a/stubs/tqdm/tqdm/contrib/slack.pyi +++ b/stubs/tqdm/tqdm/contrib/slack.pyi @@ -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__( diff --git a/stubs/tqdm/tqdm/contrib/telegram.pyi b/stubs/tqdm/tqdm/contrib/telegram.pyi index eb0fc7a4a..fd0225d80 100644 --- a/stubs/tqdm/tqdm/contrib/telegram.pyi +++ b/stubs/tqdm/tqdm/contrib/telegram.pyi @@ -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__( diff --git a/stubs/tqdm/tqdm/gui.pyi b/stubs/tqdm/tqdm/gui.pyi index a8a1844ef..7156e55cb 100644 --- a/stubs/tqdm/tqdm/gui.pyi +++ b/stubs/tqdm/tqdm/gui.pyi @@ -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 diff --git a/stubs/tqdm/tqdm/notebook.pyi b/stubs/tqdm/tqdm/notebook.pyi index 52f8d9c86..5f7d3f745 100644 --- a/stubs/tqdm/tqdm/notebook.pyi +++ b/stubs/tqdm/tqdm/notebook.pyi @@ -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 diff --git a/stubs/tqdm/tqdm/rich.pyi b/stubs/tqdm/tqdm/rich.pyi index 993d6b7ef..39445c031 100644 --- a/stubs/tqdm/tqdm/rich.pyi +++ b/stubs/tqdm/tqdm/rich.pyi @@ -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: ... diff --git a/stubs/tqdm/tqdm/tk.pyi b/stubs/tqdm/tqdm/tk.pyi index 49aebbf0a..e8a888d25 100644 --- a/stubs/tqdm/tqdm/tk.pyi +++ b/stubs/tqdm/tqdm/tk.pyi @@ -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,