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

R0201 false positives #3281

Closed
MatthijsBlom opened this issue Nov 30, 2019 · 0 comments · Fixed by #3282
Closed

R0201 false positives #3281

MatthijsBlom opened this issue Nov 30, 2019 · 0 comments · Fixed by #3282

Comments

@MatthijsBlom
Copy link
Contributor

The following five valid special method names produce R0201 Method could be a function warnings.

class C:
    def __pow__(self, other, modulo): return NotImplemented
    def __imatmul__(self, other): return NotImplemented
    def __trunc__(self): return NotImplemented
    def __floor__(self): return NotImplemented
    def __ceil__(self): return NotImplemented

Of these five, __pow__ and __imatmul__ also produce W0613 Unused argument warnings.

As far as I can tell, there are no other special method names that are not recognized as such.

I am currently looking into fixing this myself and may send a pull request in the near future.

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 a pull request may close this issue.

1 participant