"Talin" <talin at acm.org> wrote in message news:mailman.3042.1123875574.10512.python-list at python.org... > 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