[Python-Dev] problem with genexp (original) (raw)
Neal Norwitz nnorwitz at gmail.com
Mon Oct 17 07:21:00 CEST 2005
- Previous message: [Python-Dev] problem with genexp
- Next message: [Python-Dev] problem with genexp
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
On 10/10/05, Neal Norwitz <nnorwitz at gmail.com> wrote:
There's a problem with genexp's that I think really needs to get fixed. See http://python.org/sf/1167751 the details are below. This code:
>>> foo(a = i for i in range(10)) I agree with the bug report that the code should either raise a SyntaxError or do the right thing.
The change to Grammar/Grammar below seems to fix the problem and all the tests pass. Can anyone comment on whether this fix is correct/appropriate? Is there a better way to fix the problem?
-argument: [test '='] test [gen_for] # Really [keyword '='] test +argument: test [gen_for] | test '=' test ['(' gen_for ')'] # Really [keyword '='] test
n
- Previous message: [Python-Dev] problem with genexp
- Next message: [Python-Dev] problem with genexp
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]