[Tim Peters] > [...] an "intelligent" function for this would strive to balance the > sizes of the multiplicands along the way [...] > from heapq import heapreplace, heappop > def fac1(n): [...] Simple and clever. A real pleasure to read! :-) Wouldn't it make a wonderful example of `heapq' in the Library Reference? -- François Pinard http://www.iro.umontreal.ca/~pinard