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 false positive: positional-only arguments in class methods #157

Comments

@bryanforbes
Copy link
Contributor

The following code triggers B902 on the bar method:

class Foo:
    def bar(self, a, /):
        pass
@cooperlees
Copy link
Collaborator

Thanks for the report.

If someone has the cycles, would definitely accept a unit-tested PR that ignores this appropriately. And I guess the test will have to be skipped until >= 3.9?

@bryanforbes
Copy link
Contributor Author

It looks like on Python 3.8+, it should be doing node.args.posonlyargs + node.args.args. I'll submit a PR later today.

bryanforbes added a commit to bryanforbes/flake8-bugbear that referenced this issue Feb 16, 2021
bryanforbes added a commit to bryanforbes/flake8-bugbear that referenced this issue Feb 16, 2021
@bryanforbes
Copy link
Contributor Author

What would it take to get a new release with this fix in it?

@cooperlees
Copy link
Collaborator

Just time for me, I’ll try today / next few days. It’s just making sure CHANGES are up to date in the readme that takes time. The release is automated once I cut a github release. So if you have cycles to help double check that and do a PR finish that then it takes me a lot less time.

@cooperlees
Copy link
Collaborator

You also have pip install git+git://github.com/PyCQA/flake8-bugbear Support to install master.

@bryanforbes
Copy link
Contributor Author

So if you have cycles to help double check that and do a PR finish that then it takes me a lot less time.

Done: #160

@cooperlees
Copy link
Collaborator

https://github.com/PyCQA/flake8-bugbear/actions/runs/617988022

  • Released. Thanks for the nudge and help!

This was referenced Mar 11, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment