]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
bpo-40465: Document random module changes in 3.11 What's new (#31818)
authorTomáš Hrnčiar <thrnciar@redhat.com>
Thu, 24 Mar 2022 13:22:58 +0000 (14:22 +0100)
committerGitHub <noreply@github.com>
Thu, 24 Mar 2022 13:22:58 +0000 (15:22 +0200)
Doc/library/random.rst
Doc/whatsnew/3.11.rst

index 96c6300ea16f58857102109a7a55a047ee5a9082..72881b56a4b18cf41753bff3d9ee0907ddddee5a 100644 (file)
@@ -257,7 +257,7 @@ Functions for sequences
    .. versionchanged:: 3.11
 
       The *population* must be a sequence.  Automatic conversion of sets
-      to lists is longer supported.
+      to lists is no longer supported.
 
 
 .. _real-valued-distributions:
index fe6c2e24c3d2410f77ea39683e43d78998c81038..b2fdb4852360d50d0a7cbf3cf723ed0eff6126b0 100644 (file)
@@ -705,6 +705,11 @@ Changes in the Python API
   deprecated since Python 3.6.
   (Contributed by Serhiy Storchaka in :issue:`47066`.)
 
+* The *population* parameter of :func:`random.sample` must be a sequence.
+  Automatic conversion of sets to lists is no longer supported. If the sample size
+  is larger than the population size, a :exc:`ValueError` is raised.
+  (Contributed by Raymond Hettinger in :issue:`40465`.)
+
 
 Build Changes
 =============