In article <[email protected]>, <[email protected]> wrote: > >def options( heaps ): > > if heaps == []: return [] > > head, tail = heaps[:1], heaps[1:] > > # Calculate all possible moves which is the sum of > # prepending all possible head "moves" to the tail > # and appending all possible tail "moves" to the head > > return [ [h] + tail for h in range( head[0] ) ] \ > + [ head + t for t in options( tail ) ] > >Is there anything anyone could recommend to make it more "Pythonic" or >more functional. It looks clumsy next to the Haskell.
If you want more Pythonic, follow PEP8 in your formatting. ;-) -- Aahz ([email protected]) <*> http://www.pythoncraft.com/ "....Normal is what cuts off your sixth finger and your tail..." --Siobhan -- http://mail.python.org/mailman/listinfo/python-list
