Skip to content

Check Enum definition for invalid base classes #12026

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 5 commits into from
Feb 22, 2022
Merged

Check Enum definition for invalid base classes #12026

merged 5 commits into from
Feb 22, 2022

Conversation

sobolevn
Copy link
Member

@sobolevn sobolevn commented Jan 20, 2022

@97littleleaf11
Copy link
Collaborator

Something off-topic: the checker.py is somehow quite large, do you have any idea on split it into several submodules? cc @JukkaL

@sobolevn
Copy link
Member Author

There are quite a lot of stateless methods that we can extract like new check_enum_bases. We only need fail callback there 🤔

@sobolevn sobolevn requested a review from JukkaL January 28, 2022 06:56
@sobolevn sobolevn mentioned this pull request Feb 6, 2022
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.

Thanks, looks good! Sorry for the slow response, I'm slowly getting back to mypy code reviews.

@JukkaL
Copy link
Collaborator

JukkaL commented Feb 22, 2022

We can split checker.py by defining a trait/interface that contains commonly used helper methods such as fail and passing the checker instance to another module using this new trait type to avoid an import cycle. We've already split semanal.py in this way (using SemanticAnalyzerInterface), though it's still very big.

The key would be to identify groups of related functionality that make sense to be moved away to a new module. Just moving random bits and pieces to another module doesn't improve the situation much. The semanal_foo modules can perhaps act as some inspiration.

@JukkaL JukkaL merged commit 1321e9e into python:master Feb 22, 2022
sobolevn added a commit that referenced this pull request Feb 22, 2022
After merging #11805 I found out that we are missing several new `Enum` features.

This PR adds them to the docs.

Refs #12026
Refs #12035
@sobolevn sobolevn mentioned this pull request Feb 22, 2022
hauntsaninja pushed a commit that referenced this pull request Feb 23, 2022
After merging #11805 I found out that we are missing several new `Enum` features.

This PR adds them to the docs.

Refs #12026
Refs #12035
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.

Check the amount of base types in Enum
3 participants