[Python-Dev] Pre-PEP: Task-local variables

Phillip J. Eby pje at telecommunity.com
Thu Oct 20 22:29:12 CEST 2005

At 04:04 PM 10/20/2005 -0400, Jeremy Hylton wrote:
>On 10/20/05, Guido van Rossum <guido at python.org> wrote:
> > Whoa, folks! Can I ask the gentlemen to curb their enthusiasm?
> >
> > PEP 343 is still (back) on the drawing table, PEP 342 has barely been
> > implemented (did it survive the AST-branch merge?), and already you
> > are talking about adding more stuff. Please put on the brakes!
>Yes.  PEP 342 survived the merge of the AST branch.  I wonder, though,
>if the Grammar for it can be simplified at all.  I haven't read the
>PEP closely, but I found the changes a little hard to follow.  That
>is, why was the grammar changed the way it was -- or how would you
>describe the intent of the changes?

The intent was to make it so that '(yield optional_expr)' always works, and 
also that   [lvalue =] yield optional_expr works.  If you can find another 
way to hack the grammar so that both of 'em work, it's certainly okay by 
me.  The changes I made were just the simplest things I could figure out to do.

I seem to recall that the hard part was the need for 'yield expr,expr' to 
be interpreted as '(yield expr,expr)', not '(yield expr),expr', for 
backward compatibility reasons.

More information about the Python-Dev mailing list