Re: [Python-Dev] Suggestion for a new built-in - flatten

2006-09-22 Thread glyph
On Fri, 22 Sep 2006 20:55:18 +0100, Michael Foord <[EMAIL PROTECTED]> wrote: >[EMAIL PROTECTED] wrote: >>On Fri, 22 Sep 2006 18:43:42 +0100, Michael Foord >><[EMAIL PROTECTED]> wrote: >>This wouldn't be a problem except that everyone has a different idea of >>those requirements:). You didn't r

Re: [Python-Dev] Suggestion for a new built-in - flatten

2006-09-22 Thread Bob Ippolito
On 9/22/06, Josiah Carlson <[EMAIL PROTECTED]> wrote: > > "Bob Ippolito" <[EMAIL PROTECTED]> wrote: > > On 9/22/06, Brian Harring <[EMAIL PROTECTED]> wrote: > > > On Fri, Sep 22, 2006 at 12:05:19PM -0700, Bob Ippolito wrote: > > > > I think instead of adding a flatten function perhaps we should thi

Re: [Python-Dev] Suggestion for a new built-in - flatten

2006-09-22 Thread Raymond Hettinger
[Michael Foord] >I have a suggestion for a new Python built in function: 'flatten'. > ... > There are several different possible approaches in pure Python, > but is this an idea that has legs ? No legs. It has been discussed ad naseum on comp.lang.python. People seem to enjoy writing their own

Re: [Python-Dev] Suggestion for a new built-in - flatten

2006-09-22 Thread Josiah Carlson
"Bob Ippolito" <[EMAIL PROTECTED]> wrote: > On 9/22/06, Brian Harring <[EMAIL PROTECTED]> wrote: > > On Fri, Sep 22, 2006 at 12:05:19PM -0700, Bob Ippolito wrote: > > > I think instead of adding a flatten function perhaps we should think > > > about adding something like Erlang's "iolist" support.

Re: [Python-Dev] Suggestion for a new built-in - flatten

2006-09-22 Thread Michael Foord
[EMAIL PROTECTED] wrote: > On Fri, 22 Sep 2006 18:43:42 +0100, Michael Foord <[EMAIL PROTECTED]> wrote: > > >> I have a suggestion for a new Python built in function: 'flatten'. >> > > This seems superficially like a good idea, but I think adding it to Python > anywhere would do a lot more

Re: [Python-Dev] Suggestion for a new built-in - flatten

2006-09-22 Thread Bob Ippolito
On 9/22/06, Brian Harring <[EMAIL PROTECTED]> wrote: > On Fri, Sep 22, 2006 at 12:05:19PM -0700, Bob Ippolito wrote: > > On 9/22/06, Josiah Carlson <[EMAIL PROTECTED]> wrote: > > > > > > Michael Foord <[EMAIL PROTECTED]> wrote: > > > > > > > > Hello all, > > > > > > > > I have a suggestion for a ne

Re: [Python-Dev] Suggestion for a new built-in - flatten

2006-09-22 Thread glyph
On Fri, 22 Sep 2006 18:43:42 +0100, Michael Foord <[EMAIL PROTECTED]> wrote: >I have a suggestion for a new Python built in function: 'flatten'. This seems superficially like a good idea, but I think adding it to Python anywhere would do a lot more harm than good. I can see that consensus is a

Re: [Python-Dev] Suggestion for a new built-in - flatten

2006-09-22 Thread Brian Harring
On Fri, Sep 22, 2006 at 12:05:19PM -0700, Bob Ippolito wrote: > On 9/22/06, Josiah Carlson <[EMAIL PROTECTED]> wrote: > > > > Michael Foord <[EMAIL PROTECTED]> wrote: > > > > > > Hello all, > > > > > > I have a suggestion for a new Python built in function: 'flatten'. > > > > This has been brought

Re: [Python-Dev] Suggestion for a new built-in - flatten

2006-09-22 Thread Bob Ippolito
On 9/22/06, Josiah Carlson <[EMAIL PROTECTED]> wrote: > > Michael Foord <[EMAIL PROTECTED]> wrote: > > > > Hello all, > > > > I have a suggestion for a new Python built in function: 'flatten'. > > This has been brought up many times. I'm -1 on its inclusion, if only > because it's a fairly simple

Re: [Python-Dev] Suggestion for a new built-in - flatten

2006-09-22 Thread Brett Cannon
On 9/22/06, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: Michael> There are several different possible approaches in pure Python,Michael> but is this an idea that has legs ?Why not add it to itertools?  Then, if you need a true list, just calllist() on the returned iterator. Yeah, this is a

Re: [Python-Dev] Suggestion for a new built-in - flatten

2006-09-22 Thread Josiah Carlson
Michael Foord <[EMAIL PROTECTED]> wrote: > > Hello all, > > I have a suggestion for a new Python built in function: 'flatten'. This has been brought up many times. I'm -1 on its inclusion, if only because it's a fairly simple 9-line function (at least the trivial version I came up with), and n

Re: [Python-Dev] Suggestion for a new built-in - flatten

2006-09-22 Thread skip
Michael> There are several different possible approaches in pure Python, Michael> but is this an idea that has legs ? Why not add it to itertools? Then, if you need a true list, just call list() on the returned iterator. Skip ___ Python-Dev ma

[Python-Dev] Suggestion for a new built-in - flatten

2006-09-22 Thread Michael Foord
Hello all, I have a suggestion for a new Python built in function: 'flatten'. This would (as if it needs explanation) take a single sequence, where each element can be a sequence (or iterable ?) nested to an arbitrary depth. It would return a flattened list. A useful restriction could be that