summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnthony Sottile <asottile@umich.edu>2022-10-10 14:16:22 -0700
committerGitHub <noreply@github.com>2022-10-10 14:16:22 -0700
commit895fd72ca0cc6a6d378565158aa2d63a91f28249 (patch)
treea6c2765bd5f01ab3ae5148eb3d8dff6388136dd8
parente1a0055f2bbc5ec756399f29ca80c676e48cdb25 (diff)
parentb74e8b91e11360782223fd0da79941fc4efaec6b (diff)
downloadpep8-895fd72ca0cc6a6d378565158aa2d63a91f28249.tar.gz
Merge pull request #1108 from dannysepler/E231
E231 should work with tuples in brackets
-rwxr-xr-xpycodestyle.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/pycodestyle.py b/pycodestyle.py
index 542272c..2119d06 100755
--- a/pycodestyle.py
+++ b/pycodestyle.py
@@ -506,6 +506,7 @@ def missing_whitespace(logical_line):
Okay: [a, b]
Okay: (3,)
+ Okay: a[3,] = 1
Okay: a[1:4]
Okay: a[:4]
Okay: a[1:]
@@ -523,7 +524,7 @@ def missing_whitespace(logical_line):
if char == ':' and before.count('[') > before.count(']') and \
before.rfind('{') < before.rfind('['):
continue # Slice syntax, no space required
- if char == ',' and next_char == ')':
+ if char == ',' and next_char in ')]':
continue # Allow tuple with only one element: (3,)
if char == ':' and next_char == '=' and sys.version_info >= (3, 8):
continue # Allow assignment expression