[Python-ideas] yield from multiple iterables (was Re: The async API of the future: yield-from)
Guido van Rossum
guido at python.org
Sun Oct 21 00:38:52 CEST 2012
On Sat, Oct 20, 2012 at 12:25 PM, Jasper St. Pierre
<jstpierre at mecheye.net> wrote:
> I'm curious now... you keep mentioning Futures and Deferreds like
> they're two separate entities. What distinction between the two do you
> see?
They have different interfaces and you end up using them differently.
In particular, quoting myself from another thread, here is how I use
the terms:
- Future: something with roughly the interface but not necessarily the
implementation of PEP 3148.
- Deferred: the Twisted Deferred class or something with very similar
functionality (there are some in the JavaScript world).
The big difference between Futures and Deferreds is that Deferreds can
easily be chains together to create multiple stages, and each callback
is called with the value returned from the previous stage; also,
Deferreds have separate callback chains for regular values and errors.
--
--Guido van Rossum (python.org/~guido)
More information about the Python-ideas
mailing list