On 9/22/07, Bruce Frederiksen <dangyogi at gmail.com> wrote: > > I've added a new function to itertools called 'concat'. This function is > much like chain, but takes all of the iterables as a single argument. Thus > concat(some_iterables) is logically equivalent to chain(*some_iterables); > the difference being that chain(*some_iterables) results in some_iterables > being fully expanded before the call to chain, while concat(some_iterables) > only iterates on some_iterables as needed. This makes concat more > attractive when some_iterables is either expensive to expand or "infinite" > in length. > > Thus, concat(iterable) is like: > > def concat(iterables): > for it in iterables: > for element in it: > yield element > > > > I've attached an updated itertoolsmodule.c file to this email with concat > added to it. This was based on the 2.5.1 source. > > I ask that this be considered for adoption into standard python. > > Thanks in advance! > Best thing to do is to put this up on the bug tracker (bugs.python.org) and assign it to Raymond Hettinger as itertools is his baby. -Brett
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