[SciPy-Dev] special.factorial accepting floats

Andrew Nelson andyfaff at gmail.com
Thu Apr 30 23:35:30 EDT 2020


I came across this because I was setting up a CI run against Python3.9. On
Py3.9 there is a DeprecationWarning if `math.factorial` is supplied a float:

On Py3.8:
math.factorial(2.0) --> 2

On Py3.9:
math.factorial(2.0) --> 2 and emits a "DeprecationWarning: Using
factorial() with floats is deprecated"

Presumably with Py >> 3.9:
math.factorial(2.0) will raise an Exception

As you say, `math.factorial` is used by `special.factorial` for
`exact=True`. When Python3.9 is released various tests will start to fail
because of that DeprecationWarning.
I know it's early days, I'm just trying to be proactive.

- how to modify tests to account for that DeprecationWarning when
`special.factorial` is supplied a float with `exact=True`
- how test code and special.factorial code has to be modified for a post
DeprecationWarning period.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/scipy-dev/attachments/20200501/1b40678a/attachment.html>


More information about the SciPy-Dev mailing list