summaryrefslogtreecommitdiff
path: root/Grammar
diff options
context:
space:
mode:
authorBenjamin Peterson <benjamin@python.org>2009-06-09 17:29:51 +0000
committerBenjamin Peterson <benjamin@python.org>2009-06-09 17:29:51 +0000
commit04abce2207e8f1883197822f03f3148099deec3b (patch)
treee7b150119f90e6408491a6f7c86cbd6b06400a25 /Grammar
parentd18909e1f62af9ca4ac876637344b1951884b026 (diff)
downloadcpython-04abce2207e8f1883197822f03f3148099deec3b.tar.gz
explain why keyword names are not just NAME
Diffstat (limited to 'Grammar')
-rw-r--r--Grammar/Grammar4
1 files changed, 3 insertions, 1 deletions
diff --git a/Grammar/Grammar b/Grammar/Grammar
index 266ba41b81..38a1408df4 100644
--- a/Grammar/Grammar
+++ b/Grammar/Grammar
@@ -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]