Skip to content

Commit d69c15e

Browse files
authored
Merge pull request PyCQA#872 from Nekit10/master
Added support for PEP 570 (PyCQA#867)
2 parents d219c68 + 2c29cc4 commit d69c15e

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

pycodestyle.py

+4
Original file line numberDiff line numberDiff line change
@@ -860,6 +860,10 @@ def missing_whitespace_around_operator(logical_line, tokens):
860860
# Tolerate the "<>" operator, even if running Python 3
861861
# Deal with Python 3's annotated return value "->"
862862
pass
863+
elif prev_text == '/' and text == ',':
864+
# Tolerate the "/" operator in function definition
865+
# For more info see PEP570
866+
pass
863867
else:
864868
if need_space is True or need_space[1]:
865869
# A needed trailing space was not found

testsuite/python38.py

+3
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
11
#: Okay
2+
def f(a, /, b):
3+
pass
4+
#: Okay
25
if x := 1:
36
print(x)
47
if m and (token := m.group(1)):

0 commit comments

Comments
 (0)