summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--pyflakes/checker.py5
-rw-r--r--pyflakes/test/test_type_annotations.py8
2 files changed, 12 insertions, 1 deletions
diff --git a/pyflakes/checker.py b/pyflakes/checker.py
index 7b68b21..480ee00 100644
--- a/pyflakes/checker.py
+++ b/pyflakes/checker.py
@@ -1037,7 +1037,10 @@ class Checker(object):
comment = comment.split(':', 1)[1].strip()
func_match = TYPE_FUNC_RE.match(comment)
if func_match:
- parts = (func_match.group(1), func_match.group(2).strip())
+ parts = (
+ func_match.group(1).replace('*', ''),
+ func_match.group(2).strip(),
+ )
else:
parts = (comment,)
diff --git a/pyflakes/test/test_type_annotations.py b/pyflakes/test/test_type_annotations.py
index 1ed676b..40397e8 100644
--- a/pyflakes/test/test_type_annotations.py
+++ b/pyflakes/test/test_type_annotations.py
@@ -231,6 +231,14 @@ class TestTypeAnnotations(TestCase):
return a + b
""")
+ def test_typeCommentsStarArgs(self):
+ self.flakes("""
+ from mod import A, B, C, D
+ def f(a, *b, **c):
+ # type: (A, *B, **C) -> D
+ return a + b
+ """)
+
def test_typeCommentsFullSignatureWithDocstring(self):
self.flakes('''
from mod import A, B, C, D