mirror of
https://github.com/python/cpython.git
synced 2025-11-24 04:17:38 +00:00
bpo-37315: Deprecate accepting floats in math.factorial(). (GH-14147)
This commit is contained in:
parent
1ce2656f13
commit
231aad3849
5 changed files with 28 additions and 7 deletions
|
|
@ -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)
|
||||
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue