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
Bogus N805 with positional-only parameters (PEP 570) #122
Labels
Comments
jparise
added a commit
to jparise/pep8-naming
that referenced
this issue
Nov 3, 2019
`args.posonlyargs` was added to Python 3.8's AST to represent position-only arguments. These comes first in the total ordering of a function's argument groups, so we need to consider them inside of get_arg_name_tuples(). This is particularly relevant to N805, which checks the name of the first argument for methods. Fixes PyCQA#122
5j9
pushed a commit
that referenced
this issue
Nov 4, 2019
`args.posonlyargs` was added to Python 3.8's AST to represent position-only arguments. These comes first in the total ordering of a function's argument groups, so we need to consider them inside of get_arg_name_tuples(). This is particularly relevant to N805, which checks the name of the first argument for methods. Fixes #122
Wonderful! I'll plan on putting together a new package release this week that will include this fix. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Running Python 3.8.0:
Please provide the exact, unmodified output of
flake8 --bug-report
Please describe the problem or feature
Trying to use Python 3.8's new positional-only parameters (PEP 570), I'm seeing a bogus warning from pep8_naming. It seems the AST has added a new
args.posonlyargs
which pep8-naming'sget_arg_name_tuples()
is not aware of.If this is a bug report, please explain with examples (and example code) what you expected to happen and what actually happened.
The complete
run.py
:When I run
flake8 run.py
I get the following:The E225 is a known issue in pycodestyle. The N805 should not be there. The argument is named 'self', so the check should pass, but pep8_naming sees the argument named 'xyz' instead.
The text was updated successfully, but these errors were encountered: