[Python-Dev] [SPAM: 3.000] [issue11682] PEP 380 reference implementation for 3.3

Nick Coghlan ncoghlan at gmail.com
Thu Nov 10 02:50:34 CET 2011

On Thu, Nov 10, 2011 at 10:35 AM, Greg Ewing
<greg.ewing at canterbury.ac.nz> wrote:
> On 10/11/11 11:43, Tim Delaney wrote:
>> We have precedent for being more restrictive initially, and relaxing those
>> restrictions later.
>> I suggest that the more restrictive implementation go in now so that
>> people
>> can start playing with it. If the discussion comes to a consensus on more
>> relaxed syntax, that can be added later (either in 3.3 or a later
>> release).
> That's fair enough. I'll shut up now.

No worries - given the dance you had to go through in the Grammar file
to make it work in the first place, I should have realised you'd done
it deliberately. (The mention of the 'yield_from' node in the doc
patch I was reviewing is actually what got me looking into this).

As I said earlier, I'd actually be amenable to making it legal to omit
the extra parentheses for both yield & yield from in the single
argument case where there's no ambiguity (following the generator
expression precedent), but that's a tricky change given the parser
limitations. The way your patch tried to do it also allowed "f(yield
from x, 1)" which strikes me as being far too confusing to a human
reader, even if the parser understands it.


Nick Coghlan   |   ncoghlan at gmail.com   |   Brisbane, Australia

More information about the Python-Dev mailing list