Skip to content

Commit eae54ff

Browse files
committed
Merge pull request #497 from agronholm/fix_496
Fixed false E251 error when square brackets are used in function argu…
2 parents ac1e249 + 4a37706 commit eae54ff

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

pep8.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -794,9 +794,9 @@ def whitespace_around_named_parameter_equals(logical_line, tokens):
794794
if start != prev_end:
795795
yield (prev_end, message)
796796
if token_type == tokenize.OP:
797-
if text == '(':
797+
if text in '([':
798798
parens += 1
799-
elif text == ')':
799+
elif text in ')]':
800800
parens -= 1
801801
elif in_def and text == ':' and parens == 1:
802802
annotated_func_arg = True

testsuite/E25.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,5 +32,6 @@ def foo(bar = False):
3232

3333
# Annotated Function Definitions
3434
#: Okay
35-
def munge(input: AnyStr, sep: AnyStr = None, limit=1000) -> AnyStr:
35+
def munge(input: AnyStr, sep: AnyStr = None, limit=1000,
36+
extra: Union[str, dict] = None) -> AnyStr:
3637
pass

0 commit comments

Comments
 (0)