24 Jun
2018
24 Jun
'18
11:47 p.m.
jab@math.brown.edu wrote:
On Jun 23, 2018, at 21:11, Nathaniel Smith
mailto:n...@pobox.com> wrote: He's asking for an async version of the 'iter' builtin, presumably something like: async def aiter(async_callable, sentinel): while True: value = await async_callable() if value == sentinel: break yield value -n
Yes, exactly (thanks, Nathaniel). Wouldn't that be a useful built-in?
Ah, sorry, I misunderstood. I'm surprised this doesn't exist already -- it seems like an obvious thing to have along with the other async features. -- Greg