Generator for integer partitions « Python recipes « ActiveState Code

code.activestate.com code.activestate.com