Only an annotated function if in the first layer of parens
authorIan Lee <IanLee1521@gmail.com>
Mon, 22 Dec 2014 05:22:15 +0000 (21:22 -0800)
committerIan Lee <IanLee1521@gmail.com>
Mon, 29 Dec 2014 18:39:33 +0000 (10:39 -0800)
pep8.py

diff --git a/pep8.py b/pep8.py
index ca57638ffc5afa5439e18d5c10d12932b5a67100..67b32d16d9320d436d813eedf9374664117df3bc 100755 (executable)
--- a/pep8.py
+++ b/pep8.py
@@ -777,9 +777,9 @@ def whitespace_around_named_parameter_equals(logical_line, tokens):
                 parens += 1
             elif text == ')':
                 parens -= 1
-            elif in_def and text == ':':
+            elif in_def and text == ':' and parens == 1:
                 annotated_func_arg = True
-            elif parens and text == ',':
+            elif parens and text == ',' and parens == 1:
                 annotated_func_arg = False
             elif parens and text == '=' and not annotated_func_arg:
                 no_space = True