Message345828
Currently math.factorial() accepts integer-like objects (including objects with defined __index__) as well as float instances with integral value (but not arbitrary float-like objects with defined __float__). I suppose this was happen because factorial() was the first integer functions in the math module, and all other functions accepted floats at that time. See also issue7550. But now we have more pure integer functions in the math module: gcd, isqrt, comb, perm. Seems accepting floats in factorial was a mistake. Now we can fix it, and deprecate using factorial() with floats.
Initial version of factorial() accepted also non-integral numbers (except float) with defined __int__. It was fixed in issue33083. |
|
Date |
User |
Action |
Args |
2019-06-17 08:49:55 | serhiy.storchaka | set | recipients:
+ serhiy.storchaka, rhettinger, mark.dickinson, stutzbach, pablogsal |
2019-06-17 08:49:55 | serhiy.storchaka | set | messageid: <1560761395.48.0.0855458048325.issue37315@roundup.psfhosted.org> |
2019-06-17 08:49:55 | serhiy.storchaka | link | issue37315 messages |
2019-06-17 08:49:55 | serhiy.storchaka | create | |
|