Open
Description
from typing import TypeVar, Generic
T = TypeVar("T")
class FooMetaclass(type, Generic[T]): pass
class Foo(metaclass=FooMetaclass[T]): # error: Dynamic metaclass not supported for "Foo"
pass
https://mypy-play.net/?mypy=master&python=3.10&gist=d4b169a5ece08ed0607b19fff8e9b749
according to the documentation:
Mypy does not understand dynamically-computed metaclasses, such as
class A(metaclass=f()): ...
however this isn't dynamically computed, it's just a generic so mypy should be able to understand it statically