This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author rhettinger
Recipients ajaksu2, alanmcintyre, avalind, dtorp, ilan, mark.dickinson, phr, rhettinger
Date 2008-03-18.00:27:20
SpamBayes Score 0.1668977
Marked as misclassified No
Message-id <>
FWIW, I don't agree with the reasoning on the rejection.  Hundreds of
calculator layouts and school textbooks suggest that you can have a
useful factorial function without having to also add binomials and

The OP requested a simple, widely understood integer method with no
arguments.  That seems very reasonable to me.  A function or method is
not clutter if it has widespread uses and a near zero learning curve.

This is a re-invented function and it would be ashamed to not offer it
because it is a pita every time you need it and it's not already there.
 My guess is that half of long-term Python programmers have written
their own variant at some point but only a small percentage of those
went on to write a binomial coeffient function.

Eventhough this is re-invented often, it is not often re-invented well
(i.e. good error messages for non-integer or negative inputs, a fast
implementation with pre-computed values for small inputs, and being
attached to a namespace where you can find it when needed).  

To compare, I checked the somewhat clean SmallTalk Integer API and found
it had factorial, gcd, and lcm, but not  the other functions mentioned
in the thread.  See:

Re-opening for further discussion.  If someone still feels that it is a
bad idea, then go ahead and re-close; otherwise, I think we ought to
accept this guy's request.
Date User Action Args
2008-03-18 00:27:22rhettingersetspambayes_score: 0.166898 -> 0.1668977
recipients: + rhettinger, phr, mark.dickinson, dtorp, alanmcintyre, ajaksu2, avalind, ilan
2008-03-18 00:27:22rhettingersetspambayes_score: 0.166898 -> 0.166898
messageid: <>
2008-03-18 00:27:21rhettingerlinkissue2138 messages
2008-03-18 00:27:20rhettingercreate