[mypy parity] We should look at narrowing on dict (and typed dict) .get
Describe the Bug
We ran into an issue trying to migrate someone where they wanted to narrow the .get(<key>) access on a dictionary (where the key was a literal string) from Any | None to Any
This would be a good thing to support, both for migration and general usability
Sandbox Link
No response
(Only applicable for extension issues) IDE Information
No response
Example:
x: dict[str, int] = {}
if x.get("y") is not None:
assert_type(x.get("y"), int)
This issue has someone assigned, but has not had recent activity for more than 2 weeks.
If you are still working on this issue, please add a comment so everyone knows. Otherwise, please unassign yourself and allow someone else to take over.
Thank you for your contributions!
This issue has someone assigned, but has not had recent activity for more than 2 weeks.
If you are still working on this issue, please add a comment so everyone knows. Otherwise, please unassign yourself and allow someone else to take over.
Thank you for your contributions!