-
-
Notifications
You must be signed in to change notification settings - Fork 2.9k
[Feature request] Recombine complete union of enum literals into original type #9063
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
Comments
Agreed that the error message looks awkward, especially if there are many enum items. Doing this as part of the type checker is my favorite, since I'd prefer if error messages roughly corresponded to the internal representation (unless the implementation is tricky). |
ethan-leba
added a commit
to ethan-leba/mypy
that referenced
this issue
Jul 5, 2020
ethan-leba
added a commit
to ethan-leba/mypy
that referenced
this issue
Jul 5, 2020
ethan-leba
added a commit
to ethan-leba/mypy
that referenced
this issue
Jul 5, 2020
@JukkaL I've created a pull request for this issue, any time you get a chance to review would be great! |
ethan-leba
added a commit
to ethan-leba/mypy
that referenced
this issue
Mar 6, 2021
ethan-leba
added a commit
to ethan-leba/mypy
that referenced
this issue
Mar 6, 2021
TH3CHARLie
pushed a commit
that referenced
this issue
Mar 11, 2021
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This is feature that I think needs to be implemented before I can publish a PR for issue #6113.
While this isn't a bug per se, since the type is correct, but it's much less readable than displaying the original type. The problem becomes particularly bad with my implementation of #6113 , displaying
bool
asUnion[Literal[True], Literal[False]]
.My thoughts on implementation are that it should be done either:
Not sure what the best approach is, so I'd like to hear the mypy team's thoughts!
The text was updated successfully, but these errors were encountered: