[Python-ideas] x=(yield from) confusion [was:Yet another alternative name for yield-from]

Jim Jewett jimjjewett at gmail.com
Mon Apr 6 00:48:51 CEST 2009


On Fri, Apr 3, 2009 at 9:15 PM, Greg Ewing <greg.ewing at canterbury.ac.nz> wrote:
> Jim Jewett wrote:

>> err... I didn't mean both directions, I meant "from the callee to the
>> caller as a yielded value" and "from the callee to the caller as a
>> final return value that can't be yielded normally."

> I think perhaps we're misunderstanding each other. You
> seemed to be saying that the only time you would want
> a generator to return a value is when you were also
> using it to either send or receive values using yield,

Almost exactly the opposite.  I can see cases where you want
the interim yields, and I can see cases where you want the final
result -- but I'm asking how common it is to need *both*, and
whether we should really be going to such effort for it.

If you only need one or the other, I think the PEP can be greatly simplified.

-jJ

> If that's not what you meant, you'll have to explain
> more clearly what you do mean.
>
> --
> Greg
>
>



More information about the Python-ideas mailing list