[Python-ideas] Cofunctions/yield from -> fibers

Nick Coghlan ncoghlan at gmail.com
Fri Aug 13 07:35:09 CEST 2010


On Fri, Aug 13, 2010 at 3:07 PM, geremy condra <debatem1 at gmail.com> wrote:
> On Thu, Aug 12, 2010 at 9:55 PM, Greg Ewing <greg.ewing at canterbury.ac.nz> wrote:
>> On 13/08/10 13:02, Ivan Pozdeev wrote:
>>>
>>> The original proposal for introducing 'yield from' (which is still
>>> in PEP 380's name) was to delegate a part of generator's work to another
>>> generator.
>>> However, in later discussions, the focus totally shifted to
>>> cooperative multitasking.
>>
>> I still regard delegation as an important use case for
>> yield-from. I haven't dwelled much on delegation of plain
>> value-yielding generators in my examples because it seems
>> rather obvious and straightforward. My coroutine examples
>> are meant to show the motivation for some of the less-obvious
>> aspects of yield-from, such as the ability to return a value.
>
> I won't pretend to understand the current discussion or its
> motivation, but I know I would appreciate it if examples of the
> obvious-and-straightforward variety were added.

Yes, it would be nice if PEP 380's generator delegation forest didn't
get lost in the cofunction trees :)

I think the cofunction discussion suggests that there are some very
different possible answers as to what is the scheduler's
responsibility and what is the responsibility of the individual
coroutines. Picking one of them as a winner by blessing it with syntax
seems rather premature.

Cheers,
Nick.

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



More information about the Python-ideas mailing list