Commits

Derek Anderson committed 3e4b3f0

added support for kwonlyargs

Comments (0)

Files changed (2)

pyflakes/checker.py

 
             self.pushFunctionScope()
             addArgs(node.args.args)
+            addArgs(node.args.kwonlyargs)
             # vararg/kwarg identifiers are not Name nodes
             if node.args.vararg:
                 args.append(node.args.vararg)
         if node.name:
             self.handleNodeStore(node)
         self.handleChildren(node)
-        
+        

pyflakes/test/test_undefined_names.py

             print(a, b, c)
         ''')
 
+    def test_keywordOnlyArgs(self):
+        '''kwonly arg names are defined'''
+        self.flakes('''
+        def f(*, a, b=None):
+            print(a, b)
+        ''')
+
     def test_definedInGenExp(self):
         """
         Using the loop variable of a generator expression results in no