summaryrefslogtreecommitdiffstats
path: root/Doc
diff options
context:
space:
mode:
authorRaymond Hettinger <rhettinger@users.noreply.github.com>2021-05-04 08:55:40 (GMT)
committerGitHub <noreply@github.com>2021-05-04 08:55:40 (GMT)
commit70a071d9e1d65f8c168b4b96a18c86d5230789c5 (patch)
tree19523a6bc9fd724db5c4e6060af5c511c7498a97 /Doc
parent87109f4d85c93a870ee8aa0d2b394547d4636b17 (diff)
downloadcpython-70a071d9e1d65f8c168b4b96a18c86d5230789c5.zip
cpython-70a071d9e1d65f8c168b4b96a18c86d5230789c5.tar.gz
cpython-70a071d9e1d65f8c168b4b96a18c86d5230789c5.tar.bz2
bpo-40465: Remove random module features deprecated in 3.9 (GH-25874)
Diffstat (limited to 'Doc')
-rw-r--r--Doc/library/random.rst22
1 files changed, 9 insertions, 13 deletions
diff --git a/Doc/library/random.rst b/Doc/library/random.rst
index e924127..e444f95 100644
--- a/Doc/library/random.rst
+++ b/Doc/library/random.rst
@@ -86,8 +86,8 @@ Bookkeeping functions
.. versionchanged:: 3.2
Moved to the version 2 scheme which uses all of the bits in a string seed.
- .. deprecated:: 3.9
- In the future, the *seed* must be one of the following types:
+ .. versionchanged:: 3.11
+ The *seed* must be one of the following types:
*NoneType*, :class:`int`, :class:`float`, :class:`str`,
:class:`bytes`, or :class:`bytearray`.
@@ -208,13 +208,10 @@ Functions for sequences
Raises a :exc:`ValueError` if all weights are zero.
-.. function:: shuffle(x[, random])
+.. function:: shuffle(x)
Shuffle the sequence *x* in place.
- The optional argument *random* is a 0-argument function returning a random
- float in [0.0, 1.0); by default, this is the function :func:`.random`.
-
To shuffle an immutable sequence and return a new shuffled list, use
``sample(x, k=len(x))`` instead.
@@ -230,8 +227,8 @@ Functions for sequences
.. function:: sample(population, k, *, counts=None)
- Return a *k* length list of unique elements chosen from the population sequence
- or set. Used for random sampling without replacement.
+ Return a *k* length list of unique elements chosen from the population
+ sequence. Used for random sampling without replacement.
Returns a new list containing elements from the population while leaving the
original population unchanged. The resulting list is in selection order so that
@@ -257,11 +254,10 @@ Functions for sequences
.. versionchanged:: 3.9
Added the *counts* parameter.
- .. deprecated:: 3.9
- In the future, the *population* must be a sequence. Instances of
- :class:`set` are no longer supported. The set must first be converted
- to a :class:`list` or :class:`tuple`, preferably in a deterministic
- order so that the sample is reproducible.
+ .. versionchanged:: 3.11
+
+ The *population* must be a sequence. Automatic conversion of sets
+ to lists is longer supported.
.. _real-valued-distributions: