From: Raymond Hettinger Date: Sun, 8 Jul 2012 23:01:53 +0000 (-0700) Subject: Issue 15265: document the exception raised for invalid sample sizes. X-Git-Tag: v3.3.0b2~268 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=86a20f834ab4066950ef3688af00c08543ffb1b1;p=thirdparty%2FPython%2Fcpython.git Issue 15265: document the exception raised for invalid sample sizes. --- diff --git a/Doc/library/random.rst b/Doc/library/random.rst index daf7a7617860..a39b636d9c5e 100644 --- a/Doc/library/random.rst +++ b/Doc/library/random.rst @@ -150,6 +150,9 @@ Functions for sequences: argument. This is especially fast and space efficient for sampling from a large population: ``sample(range(10000000), 60)``. + If the sample size is larger than the population size, a :exc:``ValueError`` + is raised. + The following functions generate specific real-valued distributions. Function parameters are named after the corresponding variables in the distribution's equation, as used in common mathematical practice; most of these equations can