[issue33083] math.factorial accepts non-integral Decimal instances

Mark Dickinson report at bugs.python.org
Mon Mar 19 04:39:04 EDT 2018


Mark Dickinson <dickinsm at gmail.com> added the comment:

Raymond: what are your thoughts on deprecating the ability of `math.factorial` to accept a float (as in `math.factorial(5.0)` -> `120`)?

For me, I'm not sure I see the value of the deprecation. It's the usual story: the answer to "Knowing what we know now, should we have done this differently in the first place" is "Probably, yes". But "Should we change the current behaviour" is a very different question. I'm tempted to see the acceptance of integral floats as a harmless quirk, and the deprecation of that behaviour as a case of gratuitous breakage.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue33083>
_______________________________________


More information about the Python-bugs-list mailing list