[ty] Unwrap enum.nonmember values#22025
Merged
charliermarsh merged 7 commits intomainfrom Dec 19, 2025
Merged
Conversation
Diagnostic diff on typing conformance testsChanges were detected when running ty on typing conformance tests--- old-output.txt 2025-12-19 00:07:35.660229877 +0000
+++ new-output.txt 2025-12-19 00:07:37.828248076 +0000
@@ -420,7 +420,7 @@
enums_members.py:84:35: error[invalid-type-form] Type arguments for `Literal` must be `None`, a literal value (int, bool, str, or bytes), or an enum member
enums_members.py:85:1: error[type-assertion-failure] Type `Unknown` does not match asserted type `def speak(self) -> None`
enums_members.py:85:33: error[invalid-type-form] Type arguments for `Literal` must be `None`, a literal value (int, bool, str, or bytes), or an enum member
-enums_members.py:116:1: error[type-assertion-failure] Type `Unknown` does not match asserted type `Unknown | nonmember[int]`
+enums_members.py:116:1: error[type-assertion-failure] Type `Unknown` does not match asserted type `int`
enums_members.py:116:32: error[invalid-type-form] Type arguments for `Literal` must be `None`, a literal value (int, bool, str, or bytes), or an enum member
enums_members.py:128:21: info[revealed-type] Revealed type: `Unknown | Literal[2]`
enums_members.py:129:9: error[type-assertion-failure] Type `Unknown` does not match asserted type `Unknown | Literal[2]`
|
|
db36555 to
8ddff63
Compare
CodSpeed Performance ReportMerging #22025 will not alter performanceComparing Summary
Footnotes
|
enum.nonmember valuesenum.nonmember values
carljm
reviewed
Dec 17, 2025
4e3d7e5 to
e9ddec1
Compare
Member
e9ddec1 to
03f743d
Compare
This reverts commit 03f743d.
charliermarsh
added a commit
that referenced
this pull request
Dec 24, 2025
## Summary See: #22025 (comment)
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.
Summary
This PR unwraps the
enum.nonmembertype to match runtime behavior.Closes astral-sh/ty#1974.