You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Below is a contrived example. In the real world I might not actually control the metaclass for Foo or I may be inheriting from some other class that also has a metaclass.
from typing import Generic, TypeVar
class FooMeta(type):
pass
_T = TypeVar('_T')
class Foo(Generic[_T], metaclass=FooMeta):
pass
This passes MyPy just fine, but fails at runtime with:
$ python3.6 test_generics.py
Traceback (most recent call last):
File "test_generics.py", line 8, in<module>
class Foo(Generic[_T], metaclass=FooMeta):
TypeError: metaclass conflict: the metaclass of a derived class must be a (non-strict) subclass of the metaclasses of all its bases
The text was updated successfully, but these errors were encountered:
Not sure if this issue should go here or in https://github.com/python/typing
Below is a contrived example. In the real world I might not actually control the metaclass for
Foo
or I may be inheriting from some other class that also has a metaclass.This passes MyPy just fine, but fails at runtime with:
The text was updated successfully, but these errors were encountered: