-
Notifications
You must be signed in to change notification settings - Fork 109
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
B905 is raised on python 3.7 #320
Comments
Unless the check is not excluded by default, which would be a bug, this is working as intended as per #311 (comment) So the intended solution is not to enable the check for <3.10, as per the README:
|
@jakkdl but wouldn't it be good if you would check if the current python version supports that flag? So if you run on python 3.7 you get no error and if running on python 3.10 you get it. With that less configuration is needed |
The problem is that there's no easy way of figuring out what versions of python your code is supposed to run on. One could add a check so that the error isn't raised if the version of python that flake8 is running with currently is python3.7, i.e. you run it with Unfortunately specifying the required python versions of your code can be done in several different files: |
I fully unterstand your comment and the limitations. |
I'm not sure how common that case is, but probably doesn't hurt. Feel free to submit a PR, it should be as simple as if sys.version_info[:2] < 3.10:
return # pragma: no cover at the start of |
My only worry here is the one edge case and why I didn’t push this in the initial PR is if someone wants to lint >=3.10 code with <3.10 … I don’t think this is a big use case tho like you both … |
When having a zip call like
zip(a,b)
, the latest bugbear release raiseszip() without an explicit strict= parameter.
However, on python 3.7-3.9 this parameter is not present and therefore the check should ignore them
The text was updated successfully, but these errors were encountered: