KEMBAR78
Fix narrowing down TypedDict unions with enum literal types by JukkaL · Pull Request #10415 · python/mypy · GitHub
Skip to content

Conversation

JukkaL
Copy link
Collaborator

@JukkaL JukkaL commented May 4, 2021

A union of enum literals was merged back to the enum type, which broke
type narrowing. Disable merging in this case to work around the
issue.

The fix feels a bit ad hoc. However, I'd rather not spend a lot of
time figuring out a general fix, since this seems like a pretty rare
edge case.

Fixes #10414.

A union of enum literals was merged back to the enum type, which broke
type narrowing. Disable merging in this case to work around the
issue.

The fix feels a bit ad hoc. However, I'd rather not spend a lot of
time figuring out a general fix, since this seems like a pretty rare
edge case.

Fixes #10414.
@JukkaL JukkaL merged commit 0729345 into master May 4, 2021
@JukkaL JukkaL deleted the tdict-narrow-enum branch May 4, 2021 16:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

TypedDict narrowing regression with enum literal

2 participants