"Talin" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> I wanted to share
> this: a generator which returns all permutations of a list:


Try this instead:
def permuteg(lst): return ([lst[i]]+x
       for i in range(len(lst))
       for x in permute(lst[:i]+lst[i+1:])) \
       or [[]]

Alan Isaac


-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to