summaryrefslogtreecommitdiffstats
path: root/Misc
diff options
context:
space:
mode:
authorRaymond Hettinger <rhettinger@users.noreply.github.com>2020-12-28 19:10:34 (GMT)
committerGitHub <noreply@github.com>2020-12-28 19:10:34 (GMT)
commita9621bb301dba44494e81edc00e3a3b62c96af26 (patch)
treeb5b79c36977d682803b3b7fcbc35b156f18d4809 /Misc
parent1031f23fc3aed6760785bf0f8290bd2b2cce41c2 (diff)
downloadcpython-a9621bb301dba44494e81edc00e3a3b62c96af26.zip
cpython-a9621bb301dba44494e81edc00e3a3b62c96af26.tar.gz
cpython-a9621bb301dba44494e81edc00e3a3b62c96af26.tar.bz2
bpo-42222: Modernize integer test/conversion in randrange() (#23064)
Diffstat (limited to 'Misc')
-rw-r--r--Misc/NEWS.d/next/Library/2020-10-31-10-28-32.bpo-42222.Cfl1eR.rst9
1 files changed, 9 insertions, 0 deletions
diff --git a/Misc/NEWS.d/next/Library/2020-10-31-10-28-32.bpo-42222.Cfl1eR.rst b/Misc/NEWS.d/next/Library/2020-10-31-10-28-32.bpo-42222.Cfl1eR.rst
new file mode 100644
index 0000000..2f570bb
--- /dev/null
+++ b/Misc/NEWS.d/next/Library/2020-10-31-10-28-32.bpo-42222.Cfl1eR.rst
@@ -0,0 +1,9 @@
+Harmonized random.randrange() argument handling to match range().
+
+* The integer test and conversion in randrange() now uses
+ operator.index().
+* Non-integer arguments to randrange() are deprecated.
+* The *ValueError* is deprecated in favor of a *TypeError*.
+* It now runs a little faster than before.
+
+(Contributed by Raymond Hettinger and Serhiy Storchaka.)