diff options
Diffstat (limited to 'Doc')
-rw-r--r-- | Doc/library/math.rst | 3 | ||||
-rw-r--r-- | Doc/whatsnew/3.9.rst | 5 |
2 files changed, 8 insertions, 0 deletions
diff --git a/Doc/library/math.rst b/Doc/library/math.rst index ff937d2..bfce41a 100644 --- a/Doc/library/math.rst +++ b/Doc/library/math.rst @@ -71,6 +71,9 @@ Number-theoretic and representation functions Return *x* factorial as an integer. Raises :exc:`ValueError` if *x* is not integral or is negative. + .. deprecated:: 3.9 + Accepting floats with integral values (like ``5.0``) is deprecated. + .. function:: floor(x) diff --git a/Doc/whatsnew/3.9.rst b/Doc/whatsnew/3.9.rst index 62b013f..c5cb626 100644 --- a/Doc/whatsnew/3.9.rst +++ b/Doc/whatsnew/3.9.rst @@ -109,6 +109,11 @@ Build and C API Changes Deprecated ========== +* Currently :func:`math.factorial` accepts :class:`float` instances with + non-negative integer values (like ``5.0``). It raises a :exc:`ValueError` + for non-integral and negative floats. It is deprecated now. In future + Python versions it will raise a :exc:`TypeError` for all floats. + (Contributed by Serhiy Storchaka in :issue:`37315`.) Removed |