mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-09 21:46:42 +08:00
Consistently use Generic as the last base class (#10610)
This commit is contained in:
@@ -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: ...
|
||||
|
||||
@@ -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(
|
||||
|
||||
@@ -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: ...
|
||||
|
||||
Reference in New Issue
Block a user