homepage

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 <1205800042.36.0.488909235458.issue2138@psf.upfronthosting.co.za>
In-reply-to
Content
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
whatnot. 
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: 
http://www.csci.csusb.edu/dick/samples/smalltalk.methods.html#Integer%20methods
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.
History
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: <1205800042.36.0.488909235458.issue2138@psf.upfronthosting.co.za>
2008年03月18日 00:27:21rhettingerlinkissue2138 messages
2008年03月18日 00:27:20rhettingercreate

AltStyle によって変換されたページ (->オリジナル) /