Stubtest: check _value_ for ellipsis-valued stub enum members#19760
Merged
hauntsaninja merged 4 commits intopython:masterfrom Nov 3, 2025
Merged
Stubtest: check _value_ for ellipsis-valued stub enum members#19760hauntsaninja merged 4 commits intopython:masterfrom
_value_ for ellipsis-valued stub enum members#19760hauntsaninja merged 4 commits intopython:masterfrom
Conversation
A5rocks
approved these changes
Aug 30, 2025
| elif runtime_type is not None and is_subtype_helper(runtime_type, value_t.type): | ||
| should_error = False | ||
| elif runtime_type is not None: | ||
| note = " (incompatible '_value_')" |
Collaborator
There was a problem hiding this comment.
Is this intentionally making the runtime_type is None case error now? (I tried thinking about it but IDK what that means. I also don't know stubtest very well :^)
Collaborator
Author
There was a problem hiding this comment.
I also tried thinking about that, couldn't invent a case where we have found an attribute but failed to interpret its value, and decided to be cautious, reporting such "smth weird" cases as incompatibilities. Maybe this should be an assert, but I'm afraid to accidentally kill stubtest right before release...
Collaborator
Author
There was a problem hiding this comment.
Okay, almost all other checks do not reject "wtf" values as incompatible, updated for consistency.
hauntsaninja
approved these changes
Oct 11, 2025
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.
Currently stubtest allows unsound definitions:
This PR teaches
stubtestthat_value_attribute (spec) should be used as a fallback in such case.