Conversation
This comment has been minimized.
This comment has been minimized.
Contributor
|
According to mypy_primer, this change has no effect on the checked open source code. 🤖🎉 |
srittau
marked this pull request as ready for review
September 17, 2026 12:43
AlexWaygood
approved these changes
Sep 17, 2026
| # ideally this would be `_SpecialForm` (Union) | ||
| assert_type(union_type | Literal[1], types.UnionType | Any) | ||
| assert_type(union_type | Literal[1], types.UnionType | Any) # pyright: ignore[reportAssertTypeFailure] | ||
| # assert_type(union_type | Literal[1], types.UnionType | type[Literal[1]]) # this is what pyright infers |
Member
There was a problem hiding this comment.
type[Literal[1]] is a nonsense type -- it's quite unclear what it would/should mean. I don't think it should be valid to parameterize type with Literal[...]. So we could possibly report this as a bug to pyright.
Collaborator
Author
There was a problem hiding this comment.
I was wondering about that (but I'm not to familiar with "meta types"). Would you report it? I think a report by you would be clearer than me only half-understanding what I write. I would then just update the comment with a link to the issue.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes: #16408
The first version will mostly likely break on non-pyright type checkers.