LangWart: Method congestion from mutate multiplicty

Tim Chase python.list at
Mon Feb 11 01:12:57 CET 2013

> > >  flatten, flattened
> > 
> > flatten is another often requested, hard to implement correctly,
> > function. The only reason that Python doesn't have a flatten is
> > that nobody can agree on precisely what it should do.
> Steven, the definition of flatten (as relates to sequences) is
> very, VERY simple:
>     Return a new sequence that is the result of reducing
>     a nested sequence of sequences into a single depth 
>     sequence.

What should you get if you flatten


Should the result be




I've needed both cases, depending on the situation.


More information about the Python-list mailing list