summaryrefslogtreecommitdiffstats
path: root/Misc
diff options
context:
space:
mode:
authorRaymond Hettinger <python@rcn.com>2002-11-12 17:41:57 (GMT)
committerRaymond Hettinger <python@rcn.com>2002-11-12 17:41:57 (GMT)
commitf24eb35d185c0623315cfbd9977d37c509860dcf (patch)
tree336a055089a3bd51d89bf4fdc987fb90ce743e09 /Misc
parent3a7ad5c5843467dc67ddf4c6622dd466f0f42c74 (diff)
downloadcpython-f24eb35d185c0623315cfbd9977d37c509860dcf.zip
cpython-f24eb35d185c0623315cfbd9977d37c509860dcf.tar.gz
cpython-f24eb35d185c0623315cfbd9977d37c509860dcf.tar.bz2
SF patch 629637: Add sample(population, k) method to the random module.
Used for random sampling without replacement.
Diffstat (limited to 'Misc')
-rw-r--r--Misc/NEWS3
1 files changed, 3 insertions, 0 deletions
diff --git a/Misc/NEWS b/Misc/NEWS
index 89f1e2f..addd5ae 100644
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -427,6 +427,9 @@ Library
- Added operator.pow(a,b) which is equivalent to a**b.
+- Added random.sample(population,k) for random sampling without replacement.
+ Returns a k length list of unique elements chosen from the population.
+
- random.randrange(-sys.maxint-1, sys.maxint) no longer raises
OverflowError. That is, it now accepts any combination of 'start'
and 'stop' arguments so long as each is in the range of Python's