Combining @dataclass
and NamedTuple
leads to crash in Python 3.13+
#18982
Labels
@dataclass
and NamedTuple
leads to crash in Python 3.13+
#18982
Crash Report
When being told to typecheck a module that contains a class which is both derived from
NamedTuple
and decorated with@dataclass
(probably by mistake, but no matter), Mypy installed in a Python 3.13+ environment will crash.It seems to work fine for Python < 3.13.
Traceback
To Reproduce
Create a file named
bug.py
with these contents:Run Mypy installed in a Python 3.13 environment on this file, e.g. using
uvx
:Replacing
3.13
with3.12
or earlier, you can check that it worked fine for earlier Python versions.Your Environment
mypy.ini
(and other config files): None neededThe text was updated successfully, but these errors were encountered: