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
{{ message }}
Repository navigation
False positive error when subclassing List type #15040
poetry run mypy ex.py
ex.py:13: error: Metaclass conflict: the metaclass of a derived class must be a (non-strict) subclass of the metaclasses of all its bases [misc]
Found 1 error in 1 file (checked 1 source file)
Your Environment
Mypy version used: 1.2.0
Mypy command-line flags: N/A
Mypy configuration options from mypy.ini (and other config files):
Activity
ikonst commentedon Apr 12, 2023
This is probably due to #6042:
mypy/mypy/semanal.py
Lines 2363 to 2372 in 0f09be4
Can take a look @ilevkivskyi?
Since
listderives from a handful of protocols (e.g.Sequence), its metaclass isABCMeta.Changing
eliminates the error, though it's probably wrong since
type(list) is type.sobolevn commentedon Apr 12, 2023
Yes, this is due to the fact that
typeshedhasSequencein the base classes oflist.While runtime does not have it.
hauntsaninja commentedon Jun 20, 2025
#17713 makes the error here go away