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

Supportenum.nonmember for python3.11+#17376

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

Merged
sobolevn merged 2 commits intomasterfromissue-12841-nonmember
Jun 14, 2024
Merged

Conversation

@sobolevn
Copy link
Member

ngnpope reacted with hooray emoji
@github-actions
Copy link
Contributor

According tomypy_primer, this change doesn't affect type check results on a corpus of open source code. ✅

Copy link
Collaborator

@JukkaLJukkaL left a comment

Choose a reason for hiding this comment

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

It's good to have support for additional enum features.

AlexWaygood reacted with thumbs up emojisobolevn reacted with heart emoji
@sobolevn
Copy link
MemberAuthor

sobolevn commentedJun 13, 2024
edited
Loading

I will this open for a day, so others can comment.

Copy link
Member

@AlexWaygoodAlexWaygood left a comment
edited
Loading

Choose a reason for hiding this comment

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

LGTM. We could also add some similar special casing for this decorator's twin,enum.member -- currently mypy just follows the typeshed stubs, which leads to incorrect results:https://mypy-play.net/?mypy=latest&python=3.12&gist=1f3799c9117af6d8a55552e4018f526d

I'm also fine with that being done as a followup, if you prefer, though!

sobolevn reacted with thumbs up emoji
@sobolevnsobolevn merged commit3d9256b intomasterJun 14, 2024
@sobolevnsobolevn deleted the issue-12841-nonmember branchJune 14, 2024 06:10
@sobolevn
Copy link
MemberAuthor

Thanks!member will be my next PR, so merging this one.

AlexWaygood reacted with heart emoji

JukkaL pushed a commit that referenced this pull requestJun 14, 2024
There are no tests for `@enum.member` used as a decorator, because I canonly decorate classes and functions, which are not supported right now:https://mypy-play.net/?mypy=latest&python=3.12&gist=449ee8c12eba9f807cfc7832f1ea2c49```pythonimport enumclass A(enum.Enum):    class x: ...reveal_type(A.x)  # Revealed type is "def () -> __main__.A.x"```This issue is separate and rather complex, so I would prefer to solve itindependently.Refs#17376---------Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@JukkaLJukkaLJukkaL approved these changes

@JelleZijlstraJelleZijlstraAwaiting requested review from JelleZijlstra

@hauntsaninjahauntsaninjaAwaiting requested review from hauntsaninja

+1 more reviewer

@AlexWaygoodAlexWaygoodAlexWaygood approved these changes

Reviewers whose approvals may not affect merge requirements

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

3 participants

@sobolevn@JukkaL@AlexWaygood

[8]ページ先頭

©2009-2025 Movatter.jp