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

B902: Add exceptions for standard library metaclasses #415

Merged
merged 1 commit into from
Nov 26, 2023

Conversation

henzef
Copy link
Contributor

@henzef henzef commented Sep 21, 2023

I faced a false positive when deriving my metaclass from ABCMeta, which should be fixed with this commit. I also added EnumMeta to this list, because it was the only other public metaclass in the standard library.

Copy link
Collaborator

@cooperlees cooperlees left a comment

Choose a reason for hiding this comment

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

I'm not sure of the exact cause here, but CI is unhappy ...

@henzef
Copy link
Contributor Author

henzef commented Nov 8, 2023

I rebased the commit to the latest main branch in the hope that it would retrigger the CI runs, but that didn't work. Now I can no longer see the original CI results :(

EDIT: nvmd, I fixed it

@henzef henzef requested a review from cooperlees November 8, 2023 17:31
I faced a false positive when deriving my metaclass from ABCMeta, which should be fixed with this commit. I also added EnumMeta to this list, because it was the only other public metaclass in the standard library.
Copy link
Collaborator

@cooperlees cooperlees left a comment

Choose a reason for hiding this comment

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

Thanks. A worthy enhancement.

@@ -92,7 +92,7 @@ def method(self):


class non_keyword_abcmeta_1(ABCMeta): # safe
def method(self):
def method(cls):
Copy link
Collaborator

Choose a reason for hiding this comment

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

Is there any value to have both method(self) and method2(cls)?

@cooperlees cooperlees merged commit cfc2429 into PyCQA:main Nov 26, 2023
6 checks passed
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