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

no-self-use (PLR6301) false positive on methods that call super #6961

Closed
DetachHead opened this issue Aug 29, 2023 · 2 comments · Fixed by #7933
Closed

no-self-use (PLR6301) false positive on methods that call super #6961

DetachHead opened this issue Aug 29, 2023 · 2 comments · Fixed by #7933
Assignees
Labels
accepted Ready for implementation bug Something isn't working

Comments

@DetachHead
Copy link

from typing_extensions import override


class A:
    def foo(self):
        ...


class B(A):
    @override
    def foo(self):
        ...

    def bar(self):  # error: PLR6301
        super().foo()

in this case the method cannot be converted to a static method, otherwise it would break the super call

@charliermarsh charliermarsh added bug Something isn't working accepted Ready for implementation labels Aug 29, 2023
@LaBatata101
Copy link
Contributor

I can work on this one

@charliermarsh
Copy link
Member

Thanks!

charliermarsh pushed a commit that referenced this issue Oct 14, 2023
## Summary

Don't report a diagnostic if the method contains a `super()` call.

Closes #6961

## Test Plan

`cargo test`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
accepted Ready for implementation bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants