[Python-Dev] [SPAM: 3.000] [issue11682] PEP 380 reference implementation for 3.3
greg.ewing at canterbury.ac.nz
Thu Nov 10 04:33:11 CET 2011
On 10/11/11 14:50, Nick Coghlan wrote:
> 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...
> The way your patch tried to do it also allowed "f(yield
> from x, 1)" which strikes me as being far too confusing
Since 'yield from' is intended mainly for delegating to
another generator, the 'x' there will usually be a function
call, so you'll be looking at something like
f(yield from g(x), 1)
which doesn't look very confusing to me, but maybe I'm
not impartial enough to judge.
In any case, I'm now pursuing cofunctions as a better
way of doing lightweight threading, so this issue
probably doesn't matter so much.
More information about the Python-Dev