fix to still support a keyword dictionary besides kw-only args
authorStefan Behnel <scoder@users.berlios.de>
Sun, 23 Sep 2007 19:55:25 +0000 (21:55 +0200)
committerStefan Behnel <scoder@users.berlios.de>
Sun, 23 Sep 2007 19:55:25 +0000 (21:55 +0200)
Cython/Compiler/Parsing.py

index 91e697aa56e1896b2b8ab3ae8fef0828a57ba29b..e0976a5a9c7c836dd23124a15357f501fb6c3c4c 100644 (file)
@@ -1772,20 +1772,15 @@ def p_def_statement(s):
     starstar_arg = None
     if s.sy == '*':
         s.next()
+        if s.sy == 'IDENT':
+            star_arg = p_py_arg_decl(s)
         if s.sy == ',':
             s.next()
             if s.sy == 'IDENT':
                 args.extend(p_c_arg_list(s, in_pyfunc = 1, kw_only = 1))
-        else:
-            star_arg = p_py_arg_decl(s)
-            if s.sy == ',':
+            if s.sy == '**':
                 s.next()
-                if s.sy == '**':
-                    s.next()
-                    starstar_arg = p_py_arg_decl(s)
-                elif s.sy == 'IDENT':
-                    args.extend(p_c_arg_list(s, in_pyfunc = 1,
-                                             kw_only = 1))
+                starstar_arg = p_py_arg_decl(s)
     elif s.sy == '**':
         s.next()
         starstar_arg = p_py_arg_decl(s)