Commit graph

119 commits

Author SHA1 Message Date
Raymond Hettinger
8ab1258b58 Simplify code in an example 2016-11-21 10:16:01 -08:00
Raymond Hettinger
6befb64172 Extend and improve the examples for the random module 2016-11-21 01:59:39 -08:00
Raymond Hettinger
a3950e42b0 Small edits to the docs for sample() and shuffle(). 2016-11-17 01:49:54 -08:00
Raymond Hettinger
0a1a909fe2 Further refinements to the examples and recipes for the random module 2016-11-17 00:45:35 -08:00
Raymond Hettinger
00305ade58 Add another example to the recipes section of the random docs 2016-11-16 22:56:11 -08:00
Raymond Hettinger
2589ee3e2b Minor touch-ups to the random module examples 2016-11-16 21:34:17 -08:00
Raymond Hettinger
16ef5d4ae1 Add cum_weights example (simulation of a cumulative binomial distribution). 2016-10-31 22:53:52 -07:00
Raymond Hettinger
1c3a121bb0 Issue #18844: Fix-up examples for random.choices(). Remove over-specified test. 2016-10-12 01:42:10 -04:00
Raymond Hettinger
9016f2864a Issue #18844: Make the number of selections a keyword-only argument for random.choices(). 2016-09-26 21:45:57 -07:00
Raymond Hettinger
f5b7c7bfc1 Improve recipe by showing results of intermediate steps 2016-09-05 13:15:02 -07:00
Raymond Hettinger
16eb827b33 Improve docs for random.seed() 2016-09-04 11:17:28 -07:00
Raymond Hettinger
28aa4a0684 Rename weighted_choices() to just choices() 2016-09-07 00:08:44 -07:00
Raymond Hettinger
e8f1e002c6 Issue #18844: Add random.weighted_choices() 2016-09-06 17:15:29 -07:00
Raymond Hettinger
c7fac12f19 Merge 2016-09-05 13:15:20 -07:00
Raymond Hettinger
6579502c7e Merge 2016-09-04 11:17:48 -07:00
Steven D'Aprano
b2871faa87 Documentation for secrets.py 2016-04-17 01:42:33 +10:00
Georg Brandl
5d94134040 Closes #25910: fix dead and permanently redirected links in the docs. Thanks to SilentGhost for the patch. 2016-02-26 19:37:12 +01:00
Georg Brandl
92849d1721 Closes #20169: fix inner links random doc. 2016-02-19 08:57:38 +01:00
Raymond Hettinger
c89a451ae1 By popular demand, add back a security warning. 2014-05-11 02:26:23 -07:00
Raymond Hettinger
a7894f7f4c Remove the redundant and poorly worded warning message.
The paragraph above already says, clearly and correctly, that
"However, being completely deterministic, it is not suitable for
all purposes, and is completely unsuitable for cryptographic purposes."

Also we should make any promises about SystemRandom or os.urandom()
being cryptographically secure (they may be, but be can't validate
that promise).  Further, those are actual random number generators
not psuedo-random number generators.
2014-05-10 14:05:28 -07:00
Antoine Pitrou
ba69008bd0 Issue #16190: fix random module recommendation to use ssl.RAND_bytes(). 2013-08-16 19:19:40 +02:00
Ezio Melotti
8429b6784b #15831: merge with 3.2 2012-09-14 06:35:09 +03:00
Ezio Melotti
e0add76468 #15831: document multiple signatures on different lines. Patch by Chris Jerdonek. 2012-09-14 06:32:35 +03:00
Sandro Tosi
5bb665f00c merge with 3.2 2012-08-12 15:12:32 +02:00
Sandro Tosi
985104a20c it's getstatus() not setstatus(); thanks to Shaddi Hasan from docs@ 2012-08-12 15:12:15 +02:00
Raymond Hettinger
f07d949367 Fix markup 2012-07-09 12:43:57 -07:00
Raymond Hettinger
86a20f834a Issue 15265: document the exception raised for invalid sample sizes. 2012-07-08 16:01:53 -07:00
Sandro Tosi
d2cbd90539 merge with 3.2 2012-04-14 16:01:49 +02:00
Sandro Tosi
1ee17198c8 fix typo; thanks to Jérôme Mainka from docs@ 2012-04-14 16:01:17 +02:00
Georg Brandl
902e895578 merge doc fixes from 3.2 2011-09-17 20:40:35 +02:00
Georg Brandl
73dd7c71f6 Add info from the docstring for random.gammavariate() to the docs. 2011-09-17 20:36:28 +02:00
Victor Stinner
c58140c557 Issue #12049: cleanup the warning in the random module doc 2011-05-25 13:13:55 +02:00
Victor Stinner
19fb53c119 Issue #12049: improve RAND_bytes() and RAND_pseudo_bytes() documentation
Add also a security warning in the module random pointing to ssl.RAND_bytes().
2011-05-24 21:32:40 +02:00
Raymond Hettinger
4f707fd316 Separate source link from main text. 2011-01-10 19:54:11 +00:00
Raymond Hettinger
1048094037 Move source links to consistent location and remove wordy, big yellow boxes. 2011-01-10 03:26:08 +00:00
Antoine Pitrou
e72b586b02 Fix heading level 2010-12-12 20:13:31 +00:00
Raymond Hettinger
6e35394ed5 Mention itertools.accumulate(). 2010-12-04 23:42:12 +00:00
Raymond Hettinger
3cdf871a8c Neaten-up random module docs. 2010-12-02 05:35:35 +00:00
Raymond Hettinger
2fdc7b1f75 Add an example to the random docs. 2010-12-02 02:41:33 +00:00
Éric Araujo
6e6cb8e0e4 Provide links to Python source where the code is short, readable and
informative adjunct to the docs.  Forward-port of Raymond's r86225 and
r86245 using the new source reST role added in #10334.
2010-11-16 19:13:50 +00:00
Raymond Hettinger
3149f9c614 typo 2010-09-07 05:35:10 +00:00
Raymond Hettinger
b21dac1e38 Remove outdated reference to Wichmann-Hill algorithm. 2010-09-07 05:32:49 +00:00
Raymond Hettinger
0515661314 Issues #7889, #9025 and #9379: Improvements to the random module. 2010-09-07 04:44:52 +00:00
Raymond Hettinger
f763a728ad Document which part of the random module module are guaranteed. 2010-09-07 00:38:15 +00:00
Raymond Hettinger
435cb0f233 Document which part of the random module module are guaranteed. 2010-09-06 23:36:31 +00:00
Benjamin Peterson
21896a330a Merged revisions 77952,78030,78102,78104,78107,78206,78216,78296-78297,78328,78331-78332,78336,78339,78343,78378-78379,78415,78559,78717,78791 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk

........
  r77952 | mark.dickinson | 2010-02-03 10:50:14 -0600 (Wed, 03 Feb 2010) | 1 line

  Fix test_inspect.py data to match recent change to inspect_fodder.py (r77942).
........
  r78030 | benjamin.peterson | 2010-02-06 14:14:10 -0600 (Sat, 06 Feb 2010) | 1 line

  check type_getattro for correctness in a descriptor corner case
........
  r78102 | andrew.kuchling | 2010-02-07 19:35:35 -0600 (Sun, 07 Feb 2010) | 1 line

  Move distutils into its own subsection; add various items
........
  r78104 | andrew.kuchling | 2010-02-08 07:22:24 -0600 (Mon, 08 Feb 2010) | 1 line

  Add two items; move a subsection
........
  r78107 | antoine.pitrou | 2010-02-08 14:25:47 -0600 (Mon, 08 Feb 2010) | 3 lines

  Clarify and correct description for ccbench and iobench.
........
  r78206 | r.david.murray | 2010-02-16 11:55:26 -0600 (Tue, 16 Feb 2010) | 3 lines

  Make the references to Popen in the description of Call
  and check_call into links.
........
  r78216 | andrew.kuchling | 2010-02-18 08:16:48 -0600 (Thu, 18 Feb 2010) | 1 line

  Add various items
........
  r78296 | andrew.kuchling | 2010-02-21 20:08:45 -0600 (Sun, 21 Feb 2010) | 1 line

  Re-word
........
  r78297 | andrew.kuchling | 2010-02-21 20:29:10 -0600 (Sun, 21 Feb 2010) | 1 line

  #7076: mention SystemRandom class near start of the module docs; reword change description for clarity.  Noted by Shawn Ligocki.
........
  r78328 | jack.diederich | 2010-02-22 12:17:16 -0600 (Mon, 22 Feb 2010) | 1 line

  fixes issue #7530, serve_forever()
........
  r78331 | andrew.kuchling | 2010-02-22 12:38:23 -0600 (Mon, 22 Feb 2010) | 1 line

  Fix comment typo
........
  r78332 | andrew.kuchling | 2010-02-22 12:42:07 -0600 (Mon, 22 Feb 2010) | 2 lines

  #7627: MH.remove() would fail if the MH mailbox was locked;
  it would call _unlock_file() and pass it a closed file object.  Noted by Rob Austein.
........
  r78336 | jack.diederich | 2010-02-22 13:55:22 -0600 (Mon, 22 Feb 2010) | 1 line

  fixes issue #1522237, bad init check in _threading_local
........
  r78339 | jack.diederich | 2010-02-22 15:27:38 -0600 (Mon, 22 Feb 2010) | 1 line

  * fix issue#7476
........
  r78343 | andrew.kuchling | 2010-02-22 16:48:41 -0600 (Mon, 22 Feb 2010) | 10 lines

  #2560: remove an unnecessary 'for' loop from my_fgets() in Parser/myreadline.c.
  Noted by Joseph Armbruster; patch by Jessica McKellar.

  The original code was 'for (;;) {...}', where ... ended
  with a 'return -2' statement and did not contain a 'break' or 'continue'
  statement.  Therefore, the body of the loop is always executed once.

  Once upon a time there was a 'continue' in the loop, but it was removed in
  rev36346, committed by mwh on Wed Jul 7 17:44:12 2004.
........
  r78378 | jack.diederich | 2010-02-23 11:23:30 -0600 (Tue, 23 Feb 2010) | 1 line

  fixup markup error
........
  r78379 | jack.diederich | 2010-02-23 13:34:06 -0600 (Tue, 23 Feb 2010) | 1 line

   issue#6442 use in operator instead of has_key
........
  r78415 | dirkjan.ochtman | 2010-02-23 22:00:52 -0600 (Tue, 23 Feb 2010) | 1 line

  Issue #7733: add explicit reference in asyncore docs.
........
  r78559 | andrew.kuchling | 2010-03-01 13:45:21 -0600 (Mon, 01 Mar 2010) | 1 line

  #7637: update discussion of minidom.unlink() and garbage collection
........
  r78717 | benjamin.peterson | 2010-03-05 21:13:33 -0600 (Fri, 05 Mar 2010) | 1 line

  settscdump is definitely an implementation detail
........
  r78791 | andrew.kuchling | 2010-03-08 06:00:39 -0600 (Mon, 08 Mar 2010) | 1 line

  Add various items
........
2010-03-21 22:03:03 +00:00
Ezio Melotti
0639d5aeb6 Merged revisions 76904 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk

........
  r76904 | ezio.melotti | 2009-12-20 00:41:49 +0200 (Sun, 20 Dec 2009) | 1 line

  #7388: "python".capitalize() in the Doc
........
2009-12-19 23:26:38 +00:00
Georg Brandl
1824415470 Switch more function arguments docs to new-style. 2009-09-02 20:34:52 +00:00
Raymond Hettinger
be40db07c6 Issue 6261: Clarify behavior of random.uniform(). 2009-06-11 23:12:14 +00:00
Raymond Hettinger
9743fd0479 Fix typo. 2009-04-03 05:47:33 +00:00