[Python-checkins] python/dist/src/Grammar Grammar,1.48,1.49 (original) (raw)

rhettinger at users.sourceforge.net rhettinger at users.sourceforge.net
Wed May 19 04:20:37 EDT 2004


Update of /cvsroot/python/python/dist/src/Grammar In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9770/Grammar

Modified Files: Grammar Log Message: SF patch #872326: Generator expression implementation (Code contributed by Jiwon Seo.)

The documentation portion of the patch is being re-worked and will be checked-in soon. Likewise, PEP 289 will be updated to reflect Guido's rationale for the design decisions on binding behavior (as described in in his patch comments and in discussions on python-dev).

The test file, test_genexps.py, is written in doctest format and is meant to exercise all aspects of the the patch. Further additions are welcome from everyone. Please stress test this new feature as much as possible before the alpha release.

Index: Grammar

RCS file: /cvsroot/python/python/dist/src/Grammar/Grammar,v retrieving revision 1.48 retrieving revision 1.49 diff -C2 -d -r1.48 -r1.49 *** Grammar 4 Aug 2002 17:29:52 -0000 1.48 --- Grammar 19 May 2004 08:20:04 -0000 1.49


*** 81,86 **** factor: ('+'|'-'|'') factor | power power: atom trailer* ['**' factor] ! atom: '(' [testlist] ')' | '[' [listmaker] ']' | '{' [dictmaker] '}' | '' testlist1 '' | NAME | NUMBER | STRING+ listmaker: test ( list_for | (',' test)* [','] ) lambdef: 'lambda' [varargslist] ':' test trailer: '(' [arglist] ')' | '[' subscriptlist ']' | '.' NAME --- 81,87 ---- factor: ('+'|'-'|'') factor | power power: atom trailer* ['**' factor] ! atom: '(' [testlist_gexp] ')' | '[' [listmaker] ']' | '{' [dictmaker] '}' | '' testlist1 '' | NAME | NUMBER | STRING+ listmaker: test ( list_for | (',' test)* [','] )


*** 96,100 ****

arglist: (argument ',')* (argument [',']| '*' test [',' '' test] | '' test) ! argument: [test '='] test # Really [keyword '='] test

list_iter: list_for | list_if --- 97,101 ----

arglist: (argument ',')* (argument [',']| '*' test [',' '' test] | '' test) ! argument: [test '='] test [gen_for] # Really [keyword '='] test

list_iter: list_for | list_if


*** 102,105 **** --- 103,110 ---- list_if: 'if' test [list_iter]



More information about the Python-checkins mailing list