<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Sat, Nov 25, 2017 at 3:37 PM, Guido van Rossum <span dir="ltr"><<a href="mailto:guido@python.org" target="_blank">guido@python.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><div>Maybe
 you didn't realize async/await don't need an event loop? Driving an 
async/await-based coroutine is just as simple as driving a 
yield-from-based one (`await` does exactly the same thing as `yield 
from`).</div></div></div></div></blockquote><div><br></div><div>I realize I *can*, but it seems far from straightforward.  I guess this is really a python-list question or something, but what is the async/await spelling of something toy like:<br><br></div></div></div><blockquote style="margin:0 0 0 40px;border:none;padding:0px"><div class="gmail_extra"><div class="gmail_quote"><div><div><font face="monospace, monospace">In [1]: def fib():</font></div></div></div></div><div class="gmail_extra"><div class="gmail_quote"><div><div><font face="monospace, monospace">   ...:     a, b = 1, 1</font></div></div></div></div><div class="gmail_extra"><div class="gmail_quote"><div><div><font face="monospace, monospace">   ...:     while True:</font></div></div></div></div><div class="gmail_extra"><div class="gmail_quote"><div><div><font face="monospace, monospace">   ...:         yield a</font></div></div></div></div><div class="gmail_extra"><div class="gmail_quote"><div><div><font face="monospace, monospace">   ...:         a, b = b, a+b</font></div></div></div></div><div class="gmail_extra"><div class="gmail_quote"><div><div><font face="monospace, monospace">   ...:</font></div></div></div></div><div class="gmail_extra"><div class="gmail_quote"><div><div><font face="monospace, monospace"><br></font></div></div></div></div><div class="gmail_extra"><div class="gmail_quote"><div><div><font face="monospace, monospace">In [2]: from itertools import takewhile</font></div></div></div></div><div class="gmail_extra"><div class="gmail_quote"><div><div><font face="monospace, monospace"><br></font></div></div></div></div><div class="gmail_extra"><div class="gmail_quote"><div><div><font face="monospace, monospace">In [3]: list(takewhile(lambda x: x<200, fib()))</font></div></div></div></div><div class="gmail_extra"><div class="gmail_quote"><div><div><font face="monospace, monospace">Out[3]: [1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89, 144]</font></div></div></div></div></blockquote><div class="gmail_extra"><div class="gmail_quote"><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><span class="gmail-"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="auto"><div dir="auto"></div></div></blockquote></span><div>Maybe the rest of the discussion should be about deprecation vs. SyntaxError in Python 3.7.<br></div></div></div></div></blockquote><div><br></div><div>I vote SyntaxError, of course. :-)</div><div> </div></div>-- <br><div class="gmail_signature">Keeping medicines from the bloodstreams of the sick; food <br>from the bellies of the hungry; books from the hands of the <br>uneducated; technology from the underdeveloped; and putting <br>advocates of freedom in prisons.  Intellectual property is<br>to the 21st century what the slave trade was to the 16th.<br></div>
</div></div>