diff --git a/stdlib/_ctypes.pyi b/stdlib/_ctypes.pyi index 25d604218..71c249472 100644 --- a/stdlib/_ctypes.pyi +++ b/stdlib/_ctypes.pyi @@ -69,7 +69,7 @@ class _CData(metaclass=_CDataMeta): def __buffer__(self, __flags: int) -> memoryview: ... def __release_buffer__(self, __buffer: memoryview) -> None: ... -class _SimpleCData(Generic[_T], _CData): +class _SimpleCData(_CData, Generic[_T]): value: _T # The TypeVar can be unsolved here, # but we can't use overloads without creating many, many mypy false-positive errors @@ -78,7 +78,7 @@ class _SimpleCData(Generic[_T], _CData): class _CanCastTo(_CData): ... class _PointerLike(_CanCastTo): ... -class _Pointer(Generic[_CT], _PointerLike, _CData): +class _Pointer(_PointerLike, _CData, Generic[_CT]): _type_: type[_CT] contents: _CT @overload @@ -140,7 +140,7 @@ class _StructUnionBase(_CData, metaclass=_StructUnionMeta): class Union(_StructUnionBase): ... class Structure(_StructUnionBase): ... -class Array(Generic[_CT], _CData): +class Array(_CData, Generic[_CT]): @property @abstractmethod def _length_(self) -> int: ... diff --git a/stdlib/csv.pyi b/stdlib/csv.pyi index 139ba7af2..a9c7fe049 100644 --- a/stdlib/csv.pyi +++ b/stdlib/csv.pyi @@ -69,7 +69,7 @@ class excel(Dialect): ... class excel_tab(excel): ... class unix_dialect(Dialect): ... -class DictReader(Generic[_T], Iterator[_DictReadMapping[_T | Any, str | Any]]): +class DictReader(Iterator[_DictReadMapping[_T | Any, str | Any]], Generic[_T]): fieldnames: Sequence[_T] | None restkey: str | None restval: str | None diff --git a/stdlib/tempfile.pyi b/stdlib/tempfile.pyi index ea0430368..61bcde242 100644 --- a/stdlib/tempfile.pyi +++ b/stdlib/tempfile.pyi @@ -321,7 +321,7 @@ else: dir: GenericPath[AnyStr] | None = None, ) -> IO[Any]: ... -class _TemporaryFileWrapper(Generic[AnyStr], IO[AnyStr]): +class _TemporaryFileWrapper(IO[AnyStr], Generic[AnyStr]): file: IO[AnyStr] # io.TextIOWrapper, io.BufferedReader or io.BufferedWriter name: str delete: bool diff --git a/stubs/tensorflow/tensorflow/__init__.pyi b/stubs/tensorflow/tensorflow/__init__.pyi index 96c9fdb31..63b37b3d8 100644 --- a/stubs/tensorflow/tensorflow/__init__.pyi +++ b/stubs/tensorflow/tensorflow/__init__.pyi @@ -345,7 +345,7 @@ class GradientTape: _SpecProto = TypeVar("_SpecProto", bound=Message) -class TypeSpec(Generic[_SpecProto], ABC): +class TypeSpec(ABC, Generic[_SpecProto]): @property @abstractmethod def value_type(self) -> Any: ... diff --git a/stubs/tensorflow/tensorflow/data/__init__.pyi b/stubs/tensorflow/tensorflow/data/__init__.pyi index e9a75c98a..7567aaf07 100644 --- a/stubs/tensorflow/tensorflow/data/__init__.pyi +++ b/stubs/tensorflow/tensorflow/data/__init__.pyi @@ -27,7 +27,7 @@ class Iterator(_Iterator[_T1], Trackable, ABC): @abstractmethod def get_next_as_optional(self) -> tf.experimental.Optional[_T1]: ... -class Dataset(Generic[_T1], ABC): +class Dataset(ABC, Generic[_T1]): def apply(self, transformation_func: Callable[[Dataset[_T1]], Dataset[_T2]]) -> Dataset[_T2]: ... def as_numpy_iterator(self) -> Iterator[np.ndarray[Any, Any]]: ... def batch( diff --git a/stubs/tensorflow/tensorflow/experimental/__init__.pyi b/stubs/tensorflow/tensorflow/experimental/__init__.pyi index 48092c75c..1f4add7b3 100644 --- a/stubs/tensorflow/tensorflow/experimental/__init__.pyi +++ b/stubs/tensorflow/tensorflow/experimental/__init__.pyi @@ -4,7 +4,7 @@ from typing import Generic, TypeVar _T_co = TypeVar("_T_co", covariant=True) -class Optional(Generic[_T_co], ABC): +class Optional(ABC, Generic[_T_co]): def __getattr__(self, name: str) -> Incomplete: ... def __getattr__(name: str) -> Incomplete: ... diff --git a/stubs/tqdm/tqdm/asyncio.pyi b/stubs/tqdm/tqdm/asyncio.pyi index 12bef569c..3f9558419 100644 --- a/stubs/tqdm/tqdm/asyncio.pyi +++ b/stubs/tqdm/tqdm/asyncio.pyi @@ -9,7 +9,7 @@ __all__ = ["tqdm_asyncio", "tarange", "tqdm", "trange"] _T = TypeVar("_T") -class tqdm_asyncio(Generic[_T], std_tqdm[_T]): +class tqdm_asyncio(std_tqdm[_T], Generic[_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 4c7d8b15f..9ab90e8b8 100644 --- a/stubs/tqdm/tqdm/contrib/discord.pyi +++ b/stubs/tqdm/tqdm/contrib/discord.pyi @@ -15,7 +15,7 @@ class DiscordIO(MonoWorker): _T = TypeVar("_T") -class tqdm_discord(Generic[_T], tqdm_auto[_T]): +class tqdm_discord(tqdm_auto[_T], Generic[_T]): dio: Incomplete @overload def __init__( diff --git a/stubs/tqdm/tqdm/contrib/slack.pyi b/stubs/tqdm/tqdm/contrib/slack.pyi index 0f9eba602..97b3a3f6d 100644 --- a/stubs/tqdm/tqdm/contrib/slack.pyi +++ b/stubs/tqdm/tqdm/contrib/slack.pyi @@ -16,7 +16,7 @@ class SlackIO(MonoWorker): _T = TypeVar("_T") -class tqdm_slack(Generic[_T], tqdm_auto[_T]): +class tqdm_slack(tqdm_auto[_T], Generic[_T]): sio: Incomplete @overload def __init__( diff --git a/stubs/tqdm/tqdm/contrib/telegram.pyi b/stubs/tqdm/tqdm/contrib/telegram.pyi index cd2beb738..eb0fc7a4a 100644 --- a/stubs/tqdm/tqdm/contrib/telegram.pyi +++ b/stubs/tqdm/tqdm/contrib/telegram.pyi @@ -21,7 +21,7 @@ class TelegramIO(MonoWorker): _T = TypeVar("_T") -class tqdm_telegram(Generic[_T], tqdm_auto[_T]): +class tqdm_telegram(tqdm_auto[_T], Generic[_T]): tgio: Incomplete @overload def __init__( diff --git a/stubs/tqdm/tqdm/gui.pyi b/stubs/tqdm/tqdm/gui.pyi index c0db2c03a..a8a1844ef 100644 --- a/stubs/tqdm/tqdm/gui.pyi +++ b/stubs/tqdm/tqdm/gui.pyi @@ -8,7 +8,7 @@ __all__ = ["tqdm_gui", "tgrange", "tqdm", "trange"] _T = TypeVar("_T") -class tqdm_gui(Generic[_T], std_tqdm[_T]): +class tqdm_gui(std_tqdm[_T], Generic[_T]): mpl: Incomplete plt: Incomplete toolbar: Incomplete diff --git a/stubs/tqdm/tqdm/notebook.pyi b/stubs/tqdm/tqdm/notebook.pyi index d2a118fb7..52f8d9c86 100644 --- a/stubs/tqdm/tqdm/notebook.pyi +++ b/stubs/tqdm/tqdm/notebook.pyi @@ -8,7 +8,7 @@ __all__ = ["tqdm_notebook", "tnrange", "tqdm", "trange"] _T = TypeVar("_T") -class tqdm_notebook(Generic[_T], std_tqdm[_T]): +class tqdm_notebook(std_tqdm[_T], Generic[_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 fad4f54d5..993d6b7ef 100644 --- a/stubs/tqdm/tqdm/rich.pyi +++ b/stubs/tqdm/tqdm/rich.pyi @@ -33,7 +33,7 @@ class RateColumn(_ProgressColumn): _T = TypeVar("_T") -class tqdm_rich(Generic[_T], std_tqdm[_T]): +class tqdm_rich(std_tqdm[_T], Generic[_T]): def close(self) -> None: ... def clear(self, *_, **__) -> None: ... def display(self, *_, **__) -> None: ... diff --git a/stubs/tqdm/tqdm/std.pyi b/stubs/tqdm/tqdm/std.pyi index 409f3747d..534e4afcd 100644 --- a/stubs/tqdm/tqdm/std.pyi +++ b/stubs/tqdm/tqdm/std.pyi @@ -31,7 +31,7 @@ class TqdmMonitorWarning(TqdmWarning, RuntimeWarning): ... _T = TypeVar("_T") -class tqdm(Generic[_T], Iterable[_T], Comparable): +class tqdm(Iterable[_T], Comparable, Generic[_T]): monitor_interval: ClassVar[int] monitor: ClassVar[TMonitor | None] diff --git a/stubs/tqdm/tqdm/tk.pyi b/stubs/tqdm/tqdm/tk.pyi index 6d925e5d6..49aebbf0a 100644 --- a/stubs/tqdm/tqdm/tk.pyi +++ b/stubs/tqdm/tqdm/tk.pyi @@ -8,7 +8,7 @@ __all__ = ["tqdm_tk", "ttkrange", "tqdm", "trange"] _T = TypeVar("_T") -class tqdm_tk(Generic[_T], std_tqdm[_T]): +class tqdm_tk(std_tqdm[_T], Generic[_T]): @overload def __init__( self,