diff options
author | Raymond Hettinger <python@rcn.com> | 2012-07-08 23:01:53 (GMT) |
---|---|---|
committer | Raymond Hettinger <python@rcn.com> | 2012-07-08 23:01:53 (GMT) |
commit | 86a20f834ab4066950ef3688af00c08543ffb1b1 (patch) | |
tree | 276ea9043ed4b39b4b6f4350db5a5e33f1d449e9 /Doc/library/random.rst | |
parent | 42a5f4a3f283543c45ce6240b2dd38eb43f44904 (diff) | |
download | cpython-86a20f834ab4066950ef3688af00c08543ffb1b1.zip cpython-86a20f834ab4066950ef3688af00c08543ffb1b1.tar.gz cpython-86a20f834ab4066950ef3688af00c08543ffb1b1.tar.bz2 |
Issue 15265: document the exception raised for invalid sample sizes.
Diffstat (limited to 'Doc/library/random.rst')
-rw-r--r-- | Doc/library/random.rst | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/Doc/library/random.rst b/Doc/library/random.rst index daf7a76..a39b636 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 |