On Feb 5, 1:17 pm, mk <mrk...@gmail.com> wrote: > Hello everybody, > > Any better solution than this? > > def flatten(x):
Just out of interest, how often do people really need such a recursive flatten, as opposed to a single-level version? I often find myself needing a 'concat' method that turns a list of lists (or iterable of iterables) into a single list; itertools.chain does this quite nicely. But I don't think I've ever encountered a need for the full recursive version. Mark -- http://mail.python.org/mailman/listinfo/python-list