-
Notifications
You must be signed in to change notification settings - Fork 753
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
Added support for PEP 570 (#867) #872
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
code seems fine, can you make testsuite/python38.py
with:
def f(a, /, b):
pass
fwiw, this patch also fixes the problem, I don't know which one is more correct (there other "unary operators" covering the splat / etc. operations in this list (it's how named-only arguments aren't flagged): diff --git a/pycodestyle.py b/pycodestyle.py
index 6ad5456..a0c2898 100755
--- a/pycodestyle.py
+++ b/pycodestyle.py
@@ -112,7 +112,7 @@ REPORT_FORMAT = {
PyCF_ONLY_AST = 1024
SINGLETONS = frozenset(['False', 'None', 'True'])
KEYWORDS = frozenset(keyword.kwlist + ['print', 'async']) - SINGLETONS
-UNARY_OPERATORS = frozenset(['>>', '**', '*', '+', '-'])
+UNARY_OPERATORS = frozenset(['>>', '**', '*', '/', '+', '-'])
ARITHMETIC_OP = frozenset(['**', '*', '/', '//', '+', '-'])
WS_OPTIONAL_OPERATORS = ARITHMETIC_OP.union(['^', '&', '|', '<<', '>>', '%'])
# Warn for -> function annotation operator in py3.5+ (issue 803)
diff --git a/testsuite/python38.py b/testsuite/python38.py
new file mode 100644
index 0000000..2132cd5
--- /dev/null
+++ b/testsuite/python38.py
@@ -0,0 +1,2 @@
+def f(a, /, b):
+ pass |
Any updates on this? I'm having issues as well. |
Seems author is stale, should I/anyone else just create a new PR with a test added? |
I will add tests tonight |
Any update? |
testsuite/python38
Outdated
@@ -0,0 +1,3 @@ | |||
#: Okay |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
needs to be python38.py
Co-Authored-By: Anthony Sottile <asottile@umich.edu>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
actually, looks like you'll need to rebase now since |
I think it is not a good idea 'cause in this case '/' is not an unary operator |
neither is |
Either way, since * and ** are allowed for unpacking in quite a few situations, it kind of makes sense to have them in that list, but |
|
Waiting for release |
See Issue #867 or https://www.python.org/dev/peps/pep-0570/