diff options
author | Miro HronĨok <miro@hroncok.cz> | 2022-02-03 13:48:13 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-02-03 13:48:13 (GMT) |
commit | 6baa98e538b2e26f16eaaf462f99496e98d2cfb1 (patch) | |
tree | 5cf899cacf875fedade890d321db3f1e1d4ad2ff /Doc/library | |
parent | 674ab66ebdf06f187e193a3d7bde13b71ba0f9af (diff) | |
download | cpython-6baa98e538b2e26f16eaaf462f99496e98d2cfb1.zip cpython-6baa98e538b2e26f16eaaf462f99496e98d2cfb1.tar.gz cpython-6baa98e538b2e26f16eaaf462f99496e98d2cfb1.tar.bz2 |
bpo-46624: Defer to 3.12: "Remove deprecated support for non-integer values" (GH-31098)
Diffstat (limited to 'Doc/library')
-rw-r--r-- | Doc/library/random.rst | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/Doc/library/random.rst b/Doc/library/random.rst index 36f232d..da4a4f6 100644 --- a/Doc/library/random.rst +++ b/Doc/library/random.rst @@ -135,10 +135,15 @@ Functions for integers values. Formerly it used a style like ``int(random()*n)`` which could produce slightly uneven distributions. - .. versionchanged:: 3.11 - Automatic conversion of non-integer types is no longer supported. - Calls such as ``randrange(10.0)`` and ``randrange(Fraction(10, 1))`` - now raise a :exc:`TypeError`. + .. deprecated:: 3.10 + The automatic conversion of non-integer types to equivalent integers is + deprecated. Currently ``randrange(10.0)`` is losslessly converted to + ``randrange(10)``. In the future, this will raise a :exc:`TypeError`. + + .. deprecated:: 3.10 + The exception raised for non-integral values such as ``randrange(10.5)`` + or ``randrange('10')`` will be changed from :exc:`ValueError` to + :exc:`TypeError`. .. function:: randint(a, b) |