-
-
Notifications
You must be signed in to change notification settings - Fork 33.5k
Closed
Labels
Description
>>> class My[X](object): ...
...
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "<stdin>", line 1, in <generic parameters of My>
TypeError: Cannot create a consistent method resolution
order (MRO) for bases object, GenericIt looks like a correct error:
>>> from typing import Generic
>>> from typing import TypeVar
>>> T = TypeVar('T')
>>> class A(object, Generic[T]): ...
...
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
TypeError: Cannot create a consistent method resolution
order (MRO) for bases object, Generic
>>> class A(Generic[T], object): ...
...
>>> But it is not tested. I think that object is quite an important corner-case to test it explicitly.
class My[X](): is tested.