Skip to content

Commit

Permalink
Merge pull request #1012 from Zac-HD/posonly-lambda-fix
Browse files Browse the repository at this point in the history
Fix E225 for lambdas with all positional-only arguments
  • Loading branch information
asottile committed Sep 13, 2021
2 parents aa3417b + e458011 commit 94af2a9
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
4 changes: 3 additions & 1 deletion pycodestyle.py
Original file line number Diff line number Diff line change
Expand Up @@ -933,7 +933,9 @@ def missing_whitespace_around_operator(logical_line, tokens):
# ^
# def f(a, b, /):
# ^
prev_text == '/' and text in {',', ')'} or
# f = lambda a, /:
# ^
prev_text == '/' and text in {',', ')', ':'} or
# def f(a, b, /):
# ^
prev_text == ')' and text == ':'
Expand Down
3 changes: 3 additions & 0 deletions testsuite/python38.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@ def f3(
b,
):
pass


lambda a, /: None
#: Okay
if x := 1:
print(x)
Expand Down

0 comments on commit 94af2a9

Please sign in to comment.