<div dir="ltr"><br><br><div class="gmail_quote">On Sat, Apr 18, 2015 at 5:53 AM Greg Ewing <<a href="mailto:greg.ewing@canterbury.ac.nz">greg.ewing@canterbury.ac.nz</a>> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Yury Selivanov wrote:<br>
><br>
> Here's my proposal to add async/await in Python.<br>
<br>
You've essentially reinvented PEP 3152 - Cofunctions.<br>
<br>
<a href="https://www.python.org/dev/peps/pep-3152/" target="_blank">https://www.python.org/dev/peps/pep-3152/</a><br>
<br>
Here's a summary of the relationships between them:<br>
<br>
PEP 3152 Nearest equivalent in Yury's PEP<br>
-------- --------------------------------<br>
<br>
codef f(args): async def f(args):<br>
<br>
cocall f(args) await f(args)<br>
<br>
__cocall__ __await__<br>
<br>
costart() async_def()<br>
<br>
There is currently no equivalent of "async for" and<br>
"async with" in PEP 3152, but they could easily be added.<br>
I would probably spell them "cofor" and "cowith".<br>
<br>
As the author of PEP 3152 I'm obviously biased, but I<br>
think my spellings are more elegant and less disruptive<br>
to reading of the code.<br></blockquote><div><br></div><div>I prefer Yury's spellings. The use of 'async' seems more obvious to me for what the term(s) are meant to convey. It also has the side-effect of being more obvious to people coming from other programming languages (I also asked my wife what she thought A-S-Y-N-C meant and she figured out that it meant "asynchronous" and she isn't a programmer).</div><div><br></div><div>My brain also keeps trying to make actual words out of "cofor" and "cowith" unsuccessfully and just settles on gibberish and something to do with cows, respectively.</div><div><br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
PEP 3152 is currently marked as deferred. Maybe it's<br>
time to revive it? If Yury's pep is to be considered,<br>
we ought to discuss the relative merits of the two.<br></blockquote><div><br></div><div>Discussing differences in semantics makes sense if there are any.</div></div></div>