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

B027 false positive with abc.abstractclassmethod #4285

Closed
Skylion007 opened this issue May 8, 2023 · 1 comment · Fixed by #4298
Closed

B027 false positive with abc.abstractclassmethod #4285

Skylion007 opened this issue May 8, 2023 · 1 comment · Fixed by #4298
Assignees
Labels
bug Something isn't working good first issue Good for newcomers help wanted Contributions especially welcome

Comments

@Skylion007
Copy link
Contributor

Adding an abstractmethod decorator does not make sense if an abstractclassmethod decorator is used instead:
When doing an automated fixes to the PyTorch codebase I ran into an issue in the wild:

class Foo(metaclass=abc.ABCMeta):
    @abc.abstractclassmethod
    def read(self): 
        pass

should not be flagged for instance (but currently is). This should be an easy exclusion to add to the rule and a good first issue.

@charliermarsh charliermarsh added bug Something isn't working good first issue Good for newcomers help wanted Contributions especially welcome labels May 8, 2023
@charliermarsh charliermarsh self-assigned this May 9, 2023
@charliermarsh
Copy link
Member

Just gonna fix this real quick.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working good first issue Good for newcomers help wanted Contributions especially welcome
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants