Skip to content

Commit b74e8b9

Browse files
committed
E231 should work with tuples in brackets
1 parent e1a0055 commit b74e8b9

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

pycodestyle.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -506,6 +506,7 @@ def missing_whitespace(logical_line):
506506
507507
Okay: [a, b]
508508
Okay: (3,)
509+
Okay: a[3,] = 1
509510
Okay: a[1:4]
510511
Okay: a[:4]
511512
Okay: a[1:]
@@ -523,7 +524,7 @@ def missing_whitespace(logical_line):
523524
if char == ':' and before.count('[') > before.count(']') and \
524525
before.rfind('{') < before.rfind('['):
525526
continue # Slice syntax, no space required
526-
if char == ',' and next_char == ')':
527+
if char == ',' and next_char in ')]':
527528
continue # Allow tuple with only one element: (3,)
528529
if char == ':' and next_char == '=' and sys.version_info >= (3, 8):
529530
continue # Allow assignment expression

0 commit comments

Comments
 (0)