[Python-3000] Futures in Python 3000 (was Re: mechanism for handling asynchronous concurrency)
Guido van Rossum
guido at python.org
Wed Apr 19 13:27:37 CEST 2006
On 4/19/06, Greg Ewing <greg.ewing at canterbury.ac.nz> wrote:
> Andy Sy wrote:
>
> > I don't know about you, but with the addition of send() to deal with
> > the problem outlined in PEP 342, generators are starting to look more
> > and more like a Rube Goldberg contraption. Could anything be more
> > Pythonic than Io's:
> >
> > f := url @fetch // f is a future that will eventually hold the
> > // URL's contents, but you don't block on the fetch.
>
> There's a lot more to this than syntax. The oddities
> surrounding Python generators are mostly due to their
> "one-level-deep" nature, i.e. they're not full coroutines.
> And there are deep implementation reasons for that.
>
> If syntax is all you're concerned about, you could translate
> that into Python as something like
>
> f = url(future(fetch))
>
> Now, how is that future() function going to be implemented,
> again? :-)
Amen. If you want this, please spend time doing a prototype
implementation so you can tell us how it should work, in all details.
--
--Guido van Rossum (home page: http://www.python.org/~guido/)
More information about the Python-3000
mailing list