<div dir="ltr">On Sunday, June 24, 2018 at 7:48:34 PM UTC-4, Greg Ewing wrote:<blockquote class="gmail_quote" style="margin: 0;margin-left: 0.8ex;border-left: 1px #ccc solid;padding-left: 1ex;"><a href="javascript:" target="_blank" gdf-obfuscated-mailto="EKOMYTU2BAAJ" rel="nofollow" onmousedown="this.href='javascript:';return true;" onclick="this.href='javascript:';return true;">j...@math.brown.edu</a> wrote:
<br>> On Jun 23, 2018, at 21:11, Nathaniel Smith <<a>n...@pobox.com</a>
<br>> <mailto:<a>n...@pobox.com</a>>> wrote:
<br>>
<br>> He's asking for an async version of the 'iter' builtin, presumably
<br>> something like:
<br>> async def aiter(async_callable, sentinel):
<br>> while True:
<br>> value = await async_callable()
<br>> if value == sentinel:
<br>> break
<br>> yield value
<br>> -n
<br>>
<br>> Yes, exactly (thanks, Nathaniel). Wouldn't that be a useful built-in?
<br>
<br>Ah, sorry, I misunderstood.
<br>
<br>I'm surprised this doesn't exist already -- it seems like an
<br>obvious thing to have along with the other async features.
<br>
<br>--
<br>Greg
<br></blockquote><div><br></div><div>Just submitted a PR: https://github.com/python/cpython/pull/8895</div></div>