Skip to content

Marks unique enums as @unique #11181

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 our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Sep 23, 2021
Merged

Marks unique enums as @unique #11181

merged 1 commit into from
Sep 23, 2021

Conversation

sobolevn
Copy link
Member

@sobolevn sobolevn commented Sep 23, 2021

All enums in mypy are unique. Eventhough, current state of enum_plugin does not support @unique checking during mypy run, it is a good thing to have.

It will raise ValueError: duplicate values found in <enum 'ArgKind'>: CUSTOM -> ARG_NAMED during development if this rule is violated.

Copy link
Collaborator

@JukkaL JukkaL left a comment

Choose a reason for hiding this comment

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

This seems reasonable. I checked that this doesn't seem to affect mypyc.

@JukkaL JukkaL merged commit 0c1b6a2 into python:master Sep 23, 2021
@sobolevn
Copy link
Member Author

Thanks!

Highly related: #10852
@JukkaL, I would appreciate your review!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants