summaryrefslogtreecommitdiffstats
path: root/Lib/random.py
diff options
context:
space:
mode:
authorRaymond Hettinger <rhettinger@users.noreply.github.com>2020-05-02 23:45:32 (GMT)
committerGitHub <noreply@github.com>2020-05-02 23:45:32 (GMT)
commit190fac99c58232f3e0b34891872b91e50ea2f057 (patch)
tree13a0e6733986b407a8f7898f2a1829552d96e425 /Lib/random.py
parent766352320fd736e2c8ed545b4cc57563f61a0b9d (diff)
downloadcpython-190fac99c58232f3e0b34891872b91e50ea2f057.zip
cpython-190fac99c58232f3e0b34891872b91e50ea2f057.tar.gz
cpython-190fac99c58232f3e0b34891872b91e50ea2f057.tar.bz2
bpo-40465: Deprecate the optional argument to random.shuffle(). (#19867)
Diffstat (limited to 'Lib/random.py')
-rw-r--r--Lib/random.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/Lib/random.py b/Lib/random.py
index 8f840e1..f2c4f39 100644
--- a/Lib/random.py
+++ b/Lib/random.py
@@ -321,6 +321,10 @@ class Random(_random.Random):
j = randbelow(i+1)
x[i], x[j] = x[j], x[i]
else:
+ _warn('The *random* parameter to shuffle() has been deprecated\n'
+ 'since Python 3.9 and will be removed in a subsequent '
+ 'version.',
+ DeprecationWarning, 2)
_int = int
for i in reversed(range(1, len(x))):
# pick an element in x[:i+1] with which to exchange x[i]