-
-
Notifications
You must be signed in to change notification settings - Fork 2.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Crash on namedtuple + @dataclass #18527
Comments
Thanks for the report @ericbuehl! Are you able to narrow the crash down to a particular file, ideally an example you can post here? Without it, this would be quite difficult to resolve. For what it's worth, I know at least one large project which is also already running on |
@cdce8p I was able to narrow the crash down to a concise repro:
I'm not sure of the practical need for this dataclass+namedtuple but alas mypy probably shouldn't crash nonetheless |
from dataclasses import dataclass
from typing import NamedTuple
@dataclass
class Imageable(NamedTuple):
id: int
Imageable(1) # AttributeError: can't set attribute (Python) It seems that |
Crash Report
running under python 3.13.1 results in the following crash when it does not crash under 3.12.8
Traceback
To Reproduce
mypy <source dir>
Your Environment
This error occurs on a large proprietary code base. I have removed all custom configuration options and plugins normally specified in pyproject.toml, cleaned .mypy_cache dir and reproduced the error with a vanilla mypy invocation. No crash when using python 3.12.8, but traceback above occurs when switching to python 3.13.1
mypy.ini
(and other config files): noneThe text was updated successfully, but these errors were encountered: