[Python-Dev] [Python-ideas] PEP 3156 - Asynchronous IO Support Rebooted
jonathan at slenders.be
Fri Dec 21 23:26:09 CET 2012
As far as I understand, "yield from" will always work, because a Future
object can act like an iterator, and you can delegate your own generator to
this iterator at the place of "yield from".
"yield" only works if the parameter behind yield is already a Future
object. Right Guido?
In case of sleep, sleep could be implemented to return a Future object.
2012/12/21 Laurens Van Houtven <_ at lvh.cc>
> A generic comment on yield from APIs that I'm sure has been discussed in
> some e-mail I missed: is there an obvious way to know up front whether
> something needs to be yielded or yield frommed? In twisted, which is what
> I'm used to it's all deferreds; but here a future's yield from but sleep's
> On Fri, Dec 21, 2012 at 8:09 PM, Guido van Rossum <guido at python.org>wrote:
>> On Fri, Dec 21, 2012 at 11:06 AM, Jesse Noller <jnoller at gmail.com> wrote:
>> > I really do like tulip as the name. It's quite pretty.
>> I chose it because Twisted and Tornado both start with T. But those
>> have kind of dark associations; I wanted to offset that with something
>> lighter. (OTOH we could use a black tulip as a logo. :-)
>> Regardless, it's not the kind of name we tend to use for the stdlib.
>> It'll probably end up being asynclib or something...
>> --Guido van Rossum (python.org/~guido)
>> Python-ideas mailing list
>> Python-ideas at python.org
> Python-ideas mailing list
> Python-ideas at python.org
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Python-Dev