-
Notifications
You must be signed in to change notification settings - Fork 309
Literal key in narrowing for TypedDict w/o extra items #2199
Copy link
Copy link
Open
Labels
narrowingIssues with narrowing - root cause is usually narrowing, flow handling, or bothIssues with narrowing - root cause is usually narrowing, flow handling, or bothneeds-discussionAn issue where it's not clear whether there is a bug or we are behaving as expected.An issue where it's not clear whether there is a bug or we are behaving as expected.typecheckingv1-verifiedIn both V1 milestone and top-ranked (verified by ranking pipeline)In both V1 milestone and top-ranked (verified by ranking pipeline)
Milestone
Metadata
Metadata
Assignees
Labels
narrowingIssues with narrowing - root cause is usually narrowing, flow handling, or bothIssues with narrowing - root cause is usually narrowing, flow handling, or bothneeds-discussionAn issue where it's not clear whether there is a bug or we are behaving as expected.An issue where it's not clear whether there is a bug or we are behaving as expected.typecheckingv1-verifiedIn both V1 milestone and top-ranked (verified by ranking pipeline)In both V1 milestone and top-ranked (verified by ranking pipeline)
Type
Fields
Give feedbackNo fields configured for Bug.
Describe the Bug
Python: 3.12
If we explicitly check the key exists we should not give this error. Naively we could narrow to
Any, but this would apply to the whole dict, and would interact weirdly when there is a unionSandbox Link
https://pyrefly.org/sandbox/?project=N4IgZglgNgpgziAXKOBDAdgEwEYHsAeAdAA4CeS4ATrgLYAEALqcROgOZ0Q3G6UN0AqADroRAYyio4cOgBUAIgApZzGJnkQxDAJSIRdA3XyJO6BiJGYYYRvAaKGmEwt37DEG0JCkvpxk7dDQ0cAbS8fEABdEAAaEDJKayhSQgZaKAoAYjoABVJEsGS6NCw8fDoxXHRINgBXSlQGCCrCEWyAZRgYOgALBgZiOEQAemGEpJTeNmGYdGHMXDE4YcrqiDqGpqrhujBeOlQAN1RoVGxYCqqa%2Bsbm9DpcYi30OFb0MgYeqoBaQ5hKOB3OgAXjoXgAzIQAIwAJi8IhAAF84qgtBA-gAxaAwCglHAEEjkRFAA
(Only applicable for extension issues) IDE Information
No response