diff options
author | Raymond Hettinger <rhettinger@users.noreply.github.com> | 2020-05-02 23:45:32 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-05-02 23:45:32 (GMT) |
commit | 190fac99c58232f3e0b34891872b91e50ea2f057 (patch) | |
tree | 13a0e6733986b407a8f7898f2a1829552d96e425 /Lib/random.py | |
parent | 766352320fd736e2c8ed545b4cc57563f61a0b9d (diff) | |
download | cpython-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.py | 4 |
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] |