From: Benjamin Peterson Date: Tue, 9 Jun 2009 17:29:51 +0000 (+0000) Subject: explain why keyword names are not just NAME X-Git-Tag: v2.7a1~996 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=654924626eaee2fadb674ed9c4d4004195dbadea;p=python explain why keyword names are not just NAME --- 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]