-
-
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
Narrowing dict | Literal
does not work in Mypy 1.5.0
#15860
Comments
It appears to be fixed in the master branch. |
Oh great, when I created the issue it wasn't fixed on master yet, but now it seems to be fixed indeed. I don't know if you want to keep this issue open for visibility until this is released or not, so feel free to close it as you see fit. |
Looks like the original regression was in a typeshed sync 59a6c5e. Specifically, the addition of
This recently got fixed by #15837, but perhaps unintentionally |
I don't think we need to keep this open. There is little chance #15837 can be included in 1.5.1 (it is quite a major change), so you will need to wait for 1.6.0 |
Bug Report
When using Mypy 1.5.0, expressions like
dict | Literal[""]
don't narrow correctly:To Reproduce
Mypy 1.4.1
Mypy 1.5.0
Expected Behavior
Both revealed types should be
Literal[""]
. (As in Mypy 1.4.1.)Actual Behavior
Mypy 1.5.0 does not narrow the revealed type for
x
.y
gets narrowed correctly.Your Environment
See Playground links.
The text was updated successfully, but these errors were encountered: