Recursive list comprehension

Peter Hansen peter at
Mon Dec 6 19:12:15 CET 2004

Timothy Babytch wrote:
> Serhiy Storchaka wrote:
>  >>>sum([['N', 'F'], ['E'], ['D']], [])
> ['N', 'F', 'E', 'D']

Hmmm.  Maybe, unless readability as in "self-documenting code"
is important to you...

Preceding the above with "flatten = sum" would perhaps be
an adequate improvement.


More information about the Python-list mailing list