Closed ofacklam closed 3 months ago
Indeed, seams to be a limitation of MyPy, it doesn't correctly recognize the metaclass because pydantic's Metaclass does not inherit from type (https://mypy.readthedocs.io/en/stable/metaclasses.html, last point).
Thanks for pointing it out, I will adjust the docs.
Interestingly, this problem did not exist with older versions of MyPy (tried it with 0.940, there it still accepts it).
Mypy detects a metaclass conflict as soon as we subclass the ConfZ class as per default use case:
reproduce.py:
Output of mypy:
Used configuration:
Note: It seems to still be the case with confZ 2 when using
BaseConfig