Skip to content

Commit 12c0012

Browse files
authored
bpo-40465: Document random module changes in 3.11 What's new (#31818)
1 parent 3354245 commit 12c0012

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

Doc/library/random.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -257,7 +257,7 @@ Functions for sequences
257257
.. versionchanged:: 3.11
258258

259259
The *population* must be a sequence. Automatic conversion of sets
260-
to lists is longer supported.
260+
to lists is no longer supported.
261261

262262

263263
.. _real-valued-distributions:

Doc/whatsnew/3.11.rst

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -705,6 +705,11 @@ Changes in the Python API
705705
deprecated since Python 3.6.
706706
(Contributed by Serhiy Storchaka in :issue:`47066`.)
707707

708+
* The *population* parameter of :func:`random.sample` must be a sequence.
709+
Automatic conversion of sets to lists is no longer supported. If the sample size
710+
is larger than the population size, a :exc:`ValueError` is raised.
711+
(Contributed by Raymond Hettinger in :issue:`40465`.)
712+
708713

709714
Build Changes
710715
=============

0 commit comments

Comments
 (0)