Skip to content
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

[red-knot] fully consolidate display of heterogenous unions of literals #14988

Open
carljm opened this issue Dec 15, 2024 · 0 comments · May be fixed by #14993
Open

[red-knot] fully consolidate display of heterogenous unions of literals #14988

carljm opened this issue Dec 15, 2024 · 0 comments · May be fixed by #14993
Labels
help wanted Contributions especially welcome red-knot Multi-file analysis & type inference

Comments

@carljm
Copy link
Contributor

carljm commented Dec 15, 2024

We currently display Literal[1, 2] | Literal["foo"], but the spec (and other type checkers) prefer Literal[1, 2, "foo"]. We allow the latter in an annotation, but we don't display it that way.

We should probably switch to displaying this like the spec and other type checkers do.

I would leave class and function literals out of this change, since they aren't part of the spec and we may want to display them entirely differently.

@carljm carljm added the red-knot Multi-file analysis & type inference label Dec 15, 2024
@carljm carljm added the help wanted Contributions especially welcome label Dec 15, 2024
@Glyphack Glyphack linked a pull request Dec 15, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Contributions especially welcome red-knot Multi-file analysis & type inference
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant