Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Stubtest: check_value_ for ellipsis-valued stub enum members#19760

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Conversation

@sterliakov
Copy link
Collaborator

@sterliakovsterliakov commentedAug 29, 2025
edited
Loading

Currently stubtest allows unsound definitions:

# a.pyifromenumimportEnumclassE(Enum):_value_:strFOO= ...
# a.pyfromenumimportEnumclassE(Enum):FOO=0

This PR teachesstubtest that_value_ attribute (spec) should be used as a fallback in such case.

elifruntime_typeisnotNoneandis_subtype_helper(runtime_type,value_t.type):
should_error=False
elifruntime_typeisnotNone:
note=" (incompatible '_value_')"
Copy link
Collaborator

@A5rocksA5rocksAug 30, 2025
edited
Loading

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Is this intentionally making theruntime_type is None case error now? (I tried thinking about it but IDK what that means. I also don't know stubtest very well :^)

Copy link
CollaboratorAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

I also tried thinking about that, couldn't invent a case where we have found an attribute but failed to interpret itsvalue, and decided to be cautious, reporting such "smth weird" cases as incompatibilities. Maybe this should be anassert, but I'm afraid to accidentally kill stubtest right before release...

A5rocks reacted with thumbs up emoji
Copy link
CollaboratorAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Okay, almost all other checks do not reject "wtf" values as incompatible, updated for consistency.

@hauntsaninjahauntsaninja merged commit7aed696 intopython:masterNov 3, 2025
13 checks passed
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@hauntsaninjahauntsaninjahauntsaninja approved these changes

+1 more reviewer

@A5rocksA5rocksA5rocks approved these changes

Reviewers whose approvals may not affect merge requirements

Assignees

No one assigned

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

3 participants

@sterliakov@hauntsaninja@A5rocks

[8]ページ先頭

©2009-2025 Movatter.jp