Just van Rossum wrote: > from __future__ import generators > > def concat(*iterators): > for i in iterators: > for x in i: > yield x > > for x in concat(iter1, iter2): > do_something(x) Yes, this is the solution that I eventually ended up with too. However, the real point I was trying to raise was, wether interators should look like sequences regarding addition, since the two are already exchangeable in so many places (e.g. tuple unpacking). Moshe Zadka wrote: > Wasn't there talk about having an iterator module with useful stuff > like that? This would be a great idea. I've ended up with a sizeable bunch of small utility functions when playing around with generators/iterators in 2.2a1. -- Sami Hangaslammi --
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4