Skip to content
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

Move final detection for Enum in checker.py #11984

Merged
merged 6 commits into from Jan 18, 2022
Merged

Conversation

@sobolevn
Copy link
Member

@sobolevn sobolevn commented Jan 13, 2022

Changes:

  • I've moved all final detection logic from semanal.py to checker.py. Why? Because we need type checking! For example, methods, properties, and other descriptors are not counted as Enum membres
  • We don't modify .is_final anymore. Why? It is too disruptive. Now this is a special-case for Enum only

Closes #11850

JukkaL
JukkaL approved these changes Jan 17, 2022
Copy link
Collaborator

@JukkaL JukkaL left a comment

Thanks, looks good! It makes sense to do these checks during type checking. Left a few nits; feel to merge when you've addressed them (and fixed the merge conflict).

mypy/util.py Outdated Show resolved Hide resolved
test-data/unit/check-enum.test Show resolved Hide resolved
@sobolevn
Copy link
Member Author

@sobolevn sobolevn commented Jan 18, 2022

Fixed merge conflicts, rebased, waiting for the CI to pass and merging 🎉

@sobolevn
Copy link
Member Author

@sobolevn sobolevn commented Jan 18, 2022

@sobolevn sobolevn merged commit 0a03ba0 into python:master Jan 18, 2022
14 checks passed
@sobolevn
Copy link
Member Author

@sobolevn sobolevn commented Jan 18, 2022

Done! My first merged PR 🎉

@JelleZijlstra
Copy link
Member

@JelleZijlstra JelleZijlstra commented Jan 18, 2022

Congratulations!

tushar-deepsource added a commit to deepsourcelabs/mypy that referenced this issue Jan 20, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

3 participants