mirror of
https://github.com/python/cpython.git
synced 2025-08-03 08:34:29 +00:00
Take Tim's advice and have random.sample() support only sequences and sets.
This commit is contained in:
parent
28de64fd0f
commit
1acde190b2
4 changed files with 22 additions and 49 deletions
|
@ -111,8 +111,8 @@ Functions for sequences:
|
|||
|
||||
.. function:: sample(population, k)
|
||||
|
||||
Return a *k* length list of unique elements chosen from the population sequence.
|
||||
Used for random sampling without replacement.
|
||||
Return a *k* length list of unique elements chosen from the population sequence
|
||||
or set. 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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue