-
-
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
1.11 crash with TypeDict+(Not)Required and type: ignore #17608
Labels
Comments
Note that to reproduce without mypyc, you need to manually insert this assertion that would be enforced automatically by mypyc: --- a/mypy/types.py
+++ b/mypy/types.py
@@ -3108,7 +3108,8 @@ def get_proper_type(typ: Type | None) -> ProperType | None:
while isinstance(typ, TypeAliasType):
typ = typ._expand_once()
# TODO: store the name of original type alias on this type, so we can show it in errors.
- return cast(ProperType, typ)
+ assert isinstance(typ, ProperType)
+ return typ
@overload |
This was referenced Jul 30, 2024
andersk
added a commit
to andersk/mypy
that referenced
this issue
Jul 30, 2024
Fixes python#17604; fixes python#17608. (To reproduce the crash without mypyc, replace `cast(ProperType, typ)` with an assertion in `get_proper_type`.) Signed-off-by: Anders Kaseorg <[email protected]>
andersk
added a commit
to andersk/mypy
that referenced
this issue
Jul 30, 2024
Fixes python#17608. (To reproduce the crash without mypyc, replace `cast(ProperType, typ)` with an assertion in `get_proper_type`.) Signed-off-by: Anders Kaseorg <[email protected]>
andersk
added a commit
to andersk/mypy
that referenced
this issue
Jul 30, 2024
Fixes python#17604; fixes python#17608. (To reproduce the crash without mypyc, replace `cast(ProperType, typ)` with an assertion in `get_proper_type`.) Signed-off-by: Anders Kaseorg <[email protected]>
md384
pushed a commit
to md384/mypy
that referenced
this issue
Aug 14, 2024
Fixes python#17604 Fixes python#17608 Fix is trivial, rectify an obvious omission in my original PR. (cherry picked from commit b56f357)
hauntsaninja
pushed a commit
that referenced
this issue
Aug 24, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Crash Report
I upgraded to mypy 1.11 from 1.08, and previously accepted code started causing crashes.
Traceback
To Reproduce
mypy-repro.py
:(Write what you did to reproduce the crash. Full source code is
appreciated. We also very much appreciate it if you try to narrow the
source down to a small stand-alone example.)
Your Environment
In this repro, I'm using pymongo
^3.13,<4
because I cannot currently upgrade any further due to server dependencies, sobson
is untyped.mpypy mypy-repro.py
pyproject.toml
:The text was updated successfully, but these errors were encountered: