[Python-Dev] Re: Why no math.fac?

François Pinard pinard@iro.umontreal.ca
24 Aug 2002 16:59:16 -0400


[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