]> granicus.if.org Git - python/commitdiff
explain why keyword names are not just NAME
authorBenjamin Peterson <benjamin@python.org>
Tue, 9 Jun 2009 17:29:51 +0000 (17:29 +0000)
committerBenjamin Peterson <benjamin@python.org>
Tue, 9 Jun 2009 17:29:51 +0000 (17:29 +0000)
Grammar/Grammar

index 266ba41b8172b5d7502f2385e603054ab8816c04..38a1408df40e17b5a06f1f6708e123c48b9bd3d3 100644 (file)
@@ -133,7 +133,9 @@ classdef: 'class' NAME ['(' [testlist] ')'] ':' suite
 arglist: (argument ',')* (argument [',']
                          |'*' test (',' argument)* [',' '**' test] 
                          |'**' test)
-argument: test [gen_for] | test '=' test  # Really [keyword '='] test
+# The reason that keywords are test nodes instead of NAME is that using NAME
+# results in an amiguity. ast.c makes sure it's a NAME.
+argument: test [gen_for] | test '=' test
 
 list_iter: list_for | list_if
 list_for: 'for' exprlist 'in' testlist_safe [list_iter]