From c3a3c388a9f5f7ff52142865b4fe8857a5938b25 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1=C5=A1=20Hrn=C4=8Diar?= Date: Fri, 11 Mar 2022 14:10:00 +0100 Subject: [PATCH] bpo-40465: Document random module changes in 3.11 What's new --- Doc/library/random.rst | 2 +- Doc/whatsnew/3.11.rst | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/Doc/library/random.rst b/Doc/library/random.rst index 96c6300ea16f58..72881b56a4b18c 100644 --- a/Doc/library/random.rst +++ b/Doc/library/random.rst @@ -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: diff --git a/Doc/whatsnew/3.11.rst b/Doc/whatsnew/3.11.rst index b7e9dc6e9e37f8..8c36877ec101e7 100644 --- a/Doc/whatsnew/3.11.rst +++ b/Doc/whatsnew/3.11.rst @@ -693,6 +693,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 =============