Skip to content

Check Enum definition for invalid base classes - #12026

Merged
JukkaL merged 5 commits into
python:masterfrom
sobolevn:issue-11948
Feb 22, 2022
Merged

Check Enum definition for invalid base classes#12026
JukkaL merged 5 commits into
python:masterfrom
sobolevn:issue-11948

Conversation

@sobolevn

@sobolevnsobolevn commented Jan 20, 2022

Copy link
Copy Markdown
Member

@97littleleaf11

Copy link
Copy Markdown
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
Copy Markdown
MemberAuthor

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 JukkaLJanuary 28, 2022 06:56
@sobolevnsobolevn mentioned this pull request Feb 6, 2022

@JukkaLJukkaL left a comment

Copy link
Copy Markdown
Collaborator

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
Copy Markdown
Collaborator

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:masterFeb 22, 2022
@97littleleaf1197littleleaf11 mentioned this pull request 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
@sobolevnsobolevn 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 freeto 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

@sobolevn@97littleleaf11@JukkaL