diff options
author | Raymond Hettinger <rhettinger@users.noreply.github.com> | 2022-05-12 04:54:51 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-05-12 04:54:51 (GMT) |
commit | 68fec31364e96d122aae0571c14683b4ddb0ebd0 (patch) | |
tree | e7dc4bbfb5dc85b0a08c2c6c8cd9143d70e0fb3f /Doc/whatsnew | |
parent | f67d71b431af064409c1f41f6d73becee01882ae (diff) | |
download | cpython-68fec31364e96d122aae0571c14683b4ddb0ebd0.zip cpython-68fec31364e96d122aae0571c14683b4ddb0ebd0.tar.gz cpython-68fec31364e96d122aae0571c14683b4ddb0ebd0.tar.bz2 |
gh-86388 Remove deprecated behaviors in randrange() (#92677)
Diffstat (limited to 'Doc/whatsnew')
-rw-r--r-- | Doc/whatsnew/3.12.rst | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/Doc/whatsnew/3.12.rst b/Doc/whatsnew/3.12.rst index bc354c3..58fcb7d 100644 --- a/Doc/whatsnew/3.12.rst +++ b/Doc/whatsnew/3.12.rst @@ -102,8 +102,6 @@ Deprecated Removed ======= - - Porting to Python 3.12 ====================== @@ -120,6 +118,14 @@ Changes in the Python API contain ASCII letters and digits and underscore. (Contributed by Serhiy Storchaka in :gh:`91760`.) +* Removed randrange() functionality deprecated since Python 3.10. Formerly, + randrange(10.0) losslessly converted to randrange(10). Now, it raises a + TypeError. Also, the exception raised for non-integral values such as + randrange(10.5) or randrange('10') has been changed from ValueError to + TypeError. This also prevents bugs where ``randrange(1e25)`` would silently + select from a larger range than ``randrange(10**25)``. + (Originally suggested by Serhiy Storchaka gh-86388.) + Build Changes ============= |