[issue31195] Make any() and all() work with async generators

2017-08-14 Thread Brett Cannon
Brett Cannon added the comment: I figured there was something. :( Closing this as "rejected". -- resolution: -> rejected stage: -> resolved status: open -> closed ___ Python tracker __

[issue31195] Make any() and all() work with async generators

2017-08-13 Thread Yury Selivanov
Yury Selivanov added the comment: > Or am I missing something subtle here? We'll need to make any() and all() coroutines. Not simple coroutines though, but weird "hybrid" functions that preserve the old semantics + implement async stuff. I don't think this is a very good idea. Maybe we shou

[issue31195] Make any() and all() work with async generators

2017-08-13 Thread Brett Cannon
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__