Re: async/await in Python
[Posted May 13, 2015 by jake]
| From: |
| Greg Ewing <greg.ewing-F+z8Qja7x9Xokq/tPzqvJg-AT-public.gmane.org> |
| To: |
| python-ideas <python-ideas-+ZN9ApsXKcEdnm+yROfE0A-AT-public.gmane.org> |
| Subject: |
| Re: async/await in Python |
| Date: |
| Sat, 18 Apr 2015 12:21:36 +1200 |
| Message-ID: |
| <5531A390.8060405@canterbury.ac.nz> |
Yury Selivanov wrote:
>
> Here's my proposal to add async/await in Python.
You've essentially reinvented PEP 3152 - Cofunctions.
https://www.python.org/dev/peps/pep-3152/
Here's a summary of the relationships between them:
PEP 3152 Nearest equivalent in Yury's PEP
-------- --------------------------------
codef f(args): async def f(args):
cocall f(args) await f(args)
__cocall__ __await__
costart() async_def()
There is currently no equivalent of "async for" and
"async with" in PEP 3152, but they could easily be added.
I would probably spell them "cofor" and "cowith".
As the author of PEP 3152 I'm obviously biased, but I
think my spellings are more elegant and less disruptive
to reading of the code.
PEP 3152 is currently marked as deferred. Maybe it's
time to revive it? If Yury's pep is to be considered,
we ought to discuss the relative merits of the two.
--
Greg
_______________________________________________
Python-ideas mailing list
Python-ideas-+ZN9ApsXKcEdnm+yROfE0A@public.gmane.org
https://mail.python.org/mailman/listinfo/python-ideas
Code of Conduct: http://python.org/psf/codeofconduct/