New submission from Serhiy Storchaka <storchaka+cpyt...@gmail.com>:

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.

----------
components: Extension Modules
messages: 345828
nosy: mark.dickinson, pablogsal, rhettinger, serhiy.storchaka, stutzbach
priority: normal
severity: normal
status: open
title: Deprecate using math.factorial() with floats
type: enhancement
versions: Python 3.9

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue37315>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to