-
-
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 involving tuple[Unpack[tuple]]
annotation
#16380
Comments
A more minimal example: from typing import Unpack
def test(*x: object): ...
keys: tuple[Unpack[tuple]]
test(keys, 1) And this is actually a counter-example to the code I never fully understood. I will submit a fix either later today or tomorrow morning. |
Unpack
to f-stringtuple[Unpack[tuple]]
annotation
Thanks! I have changed the title to better reflect the crash. I wrongly thought the f-strings were involved, as changing the f-string to, e.g., a |
Is the codebase you ran into this on open source? |
No, sorry. |
Fixes #16380 Fix is quite straightforward, what was an `assert` really needs to be an `if`. --------- Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
Fixes #16380 Fix is quite straightforward, what was an `assert` really needs to be an `if`. --------- Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
Crash Report
Ran the
mypy
development branch on a codebase and it crashed. I managed to reduce the crash to a function parameter typed as a nestedUnpack
that was passed to an f-string.The reason I was using the development branch of
mypy
was that it contained a bug fix not yet in the latest release. Downgrading to 1.6.1 causes the crash to stop happening unless you pass--enable-incomplete-feature=Unpack
.The closest issue I found was #16285 which seems to be closed as completed, but I am still able to produce this crash on the latest development branch which includes the commit that closed the issue.
Traceback
To Reproduce
Your Environment
The text was updated successfully, but these errors were encountered: