Take Tim's advice and have random.sample() support only sequences and sets.

This commit is contained in:
Raymond Hettinger 2008-01-14 01:00:53 +00:00
parent 28de64fd0f
commit 1acde190b2
4 changed files with 22 additions and 49 deletions

View file

@ -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