[New-bugs-announce] [issue31195] Make any() and all() work with async generators
report at bugs.python.org
Sun Aug 13 14:41:23 EDT 2017
New submission from Brett Cannon:
It would be great if I could do something like:
if any(x for async x in aiter()): ...
But as of right now, any() complains that "TypeError: 'async_generator' object is not iterable". I would assume that any() and all() could be updated to look for __aiter__() instead of just __iter__() and do the right thing in either case? Or am I missing something subtle here?
components: Library (Lib)
nosy: brett.cannon, giampaolo.rodola, haypo, yselivanov
title: Make any() and all() work with async generators
versions: Python 3.7
Python tracker <report at bugs.python.org>
More information about the New-bugs-announce