[Python-Dev] Adding concat function to itertools (original) (raw)
Damien Miller djm at mindrot.org
Sat Sep 29 00:09:32 CEST 2007
- Previous message: [Python-Dev] Adding concat function to itertools
- Next message: [Python-Dev] Adding concat function to itertools
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
On Fri, 28 Sep 2007, Raymond Hettinger wrote:
> Interestingly, they seem to all have something to do with dictionary > values() that are themselves iterable.
I see. These are instances of a recurring general use case of chain() as a one-level flattener. Will give consideration to changing the signature of chain() for Py3.0. Besides the concat() variation using a single iterable input, another alternative is the min()/max() style signature where one input is interpreted as iterable and multiple arguments as comprising an input tuple.
Has anyone considered making the iterator add operator perform something similar to chain? I.e.
list(a + b) => [ a0, a1, ... an, b0, b1, bn]
(where "a" and "b" are iterables)
-d
- Previous message: [Python-Dev] Adding concat function to itertools
- Next message: [Python-Dev] Adding concat function to itertools
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]