-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
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
Mypy 1.3.0 crashes when using dictionary unpacking #15246
Comments
Simpler repro: run mypy on this snippet: from typing import Any
def get_annotations(cls: type) -> dict[str, Any]:
"""Return a dict of all annotations for a class and its parents."""
annotations: dict[str, Any] = {}
for ancestor in cls.__mro__:
annotations = {**annotations, **getattr(ancestor, "__annotations__", {})}
return annotations With this pyproject.toml file: [tool.mypy]
follow_imports = "skip"
follow_imports_for_stubs = true Both of the above flags appear to be required to reproduce the crash, but none of the others are. |
Lol, probably prevents mypy from figuring out what |
Thanks @AlexWaygood! 🙏 I added that minimal example to the repro instructions in the description |
Thanks for the report! Note that global |
@hauntsaninja I didn't even notice that we had |
Crash Report
Mypy 1.3.0 crashes with an internal error when it encounters dictionary unpacking, e.g.
**mydict
.Traceback
From
1.3.0
:From
master
:To Reproduce
Using this file:
And this minimal
pyproject.toml
(thanks @AlexWaygood!)And running this command:
I get the traceback above.
Your Environment
--show-traceback
mypy.ini
(and other config files):Theories
The text was updated successfully, but these errors were encountered: