[Python-ideas] Revised revised revised PEP on yield-from

Guido van Rossum guido at python.org
Wed Feb 18 05:22:51 CET 2009

On Tue, Feb 17, 2009 at 7:38 PM, Jesse Noller <jnoller at gmail.com> wrote:
> On Tue, Feb 17, 2009 at 10:29 PM, Greg Ewing
> <greg.ewing at canterbury.ac.nz> wrote:
>> Guido van Rossum wrote:
>>> Also, it would seem you cannot write
>>> functions running in lightweight threads that are also "ordinary"
>>> generators, since yield is reserved for "calling" the scheduler.
>> Yes, that's a problem. I don't have a good answer
>> for that at the moment.
>> BTW, I have another idea for an example (a thread
>> scheduler and an example using it to deal with
>> sockets asynchronously). Is anyone still interested,
>> or have you all seen enough already?
>> --
>> Greg
> Oooh, oooh I am! I am! (still interested that is).

I think it would be a better example than the parser example you gave
before. Somehow the parser example is not very convincing, perhaps
because it feels a bit unnatural to see a parser as a bunch of threads
or coroutines -- the conventional way to write (which you presented as
a starting point) works just fine.

--Guido van Rossum (home page: http://www.python.org/~guido/)

More information about the Python-ideas mailing list