Skip to content

Commit 94af2a9

Browse files
authored
Merge pull request #1012 from Zac-HD/posonly-lambda-fix
Fix E225 for lambdas with all positional-only arguments
2 parents aa3417b + e458011 commit 94af2a9

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

pycodestyle.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -933,7 +933,9 @@ def missing_whitespace_around_operator(logical_line, tokens):
933933
# ^
934934
# def f(a, b, /):
935935
# ^
936-
prev_text == '/' and text in {',', ')'} or
936+
# f = lambda a, /:
937+
# ^
938+
prev_text == '/' and text in {',', ')', ':'} or
937939
# def f(a, b, /):
938940
# ^
939941
prev_text == ')' and text == ':'

testsuite/python38.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,9 @@ def f3(
1313
b,
1414
):
1515
pass
16+
17+
18+
lambda a, /: None
1619
#: Okay
1720
if x := 1:
1821
print(x)

0 commit comments

Comments
 (0)