> I'm using list(l) to copy the list, Tero uses l[:], but the idea is > the same. >
Thanks a lot for your response and the hint. > But do you just want all proper partitions of lst? Then this is much > simpler: > lst = [0, 1, 2] > s = [(lst[:i], lst[i:]) for i in range(1, len(lst))] Ah, thanks a lot for that nice line of code! Python keeps astonishing me ;-) Cheers, Gabriel. -- ______________________________________________________________ Life is so constructed that the event does not, cannot, will not match the expectation. (Charlotte Bronte) ______________________________________________________________ zach in.tu-clausthal.de __@/' www.gabrielzachmann.org ______________________________________________________________ -- http://mail.python.org/mailman/listinfo/python-list