Commit Graph

103 Commits

Author SHA1 Message Date
Serhiy Storchaka
f066bd94b9 bpo-37319: Improve documentation, code and tests of randrange. (GH-19112) 2021-01-25 23:02:04 +02:00
Raymond Hettinger
a9621bb301 bpo-42222: Modernize integer test/conversion in randrange() (#23064) 2020-12-28 11:10:34 -08:00
Raymond Hettinger
5646414ae1 bpo-42559: Not that getrandbits() is non-negative. (GH-23843) 2020-12-18 17:03:10 -08:00
Raymond Hettinger
3cde3788b6 bpo-39108: Document threading issues for random.gauss() (GH-22928) 2020-10-25 07:59:01 -07:00
Raymond Hettinger
b67cbbda3a Minor clarification (GH-22708) 2020-10-14 23:41:55 -07:00
Raymond Hettinger
f2bd04f689 Improve recipe readability (GH-22685) 2020-10-13 16:41:26 -07:00
Raymond Hettinger
8b2ff4c03d Add recipe for a version of random() with a larger population (GH-22664) 2020-10-13 11:54:21 -07:00
Ram Rachum
b0dfc75816 bpo-41773: Raise exception for non-finite weights in random.choices(). (GH-22441) 2020-09-28 18:32:10 -07:00
Andre Delfino
e8a2076e14 Revert "Fix all Python Cookbook links (#22205)" (GH-22424)
This commit reverts commit ac0333e1e1 as the original links are working again and they provide extended features such as comments and alternative versions.
2020-09-27 01:47:25 +01:00
Andre Delfino
ac0333e1e1 Fix all Python Cookbook links (#22205) 2020-09-15 21:13:26 +01:00
Raymond Hettinger
e16d2f7c37 Improve output summary in the examples and recipes section (GH-20285) 2020-05-21 01:37:38 -07:00
Raymond Hettinger
81a5fc38e8 bpo-40541: Add optional *counts* parameter to random.sample() (GH-19970) 2020-05-08 07:53:15 -07:00
Raymond Hettinger
f01d1be97d bpo-40286: Put methods in correct sections. Add security notice to use secrets for session tokens. (GH-19870) 2020-05-04 22:52:13 -07:00
Mathieu Dupuy
8aab84312e Fix missing space in docs(GH-19866) 2020-05-02 16:50:47 -07:00
Raymond Hettinger
190fac99c5 bpo-40465: Deprecate the optional argument to random.shuffle(). (#19867) 2020-05-02 16:45:32 -07:00
Raymond Hettinger
d3a8d616fa Small improvements to the recipes and examples. (GH-19635)
* Add underscores to long numbers to improve readability
* Use bigger dataset in the bootstrapping example
* Convert single-server queue example to more useful multi-server queue
2020-04-21 16:11:00 -07:00
Raymond Hettinger
4fe002045f bpo-40325: Deprecate set object support in random.sample() (GH-19591) 2020-04-19 00:36:42 -07:00
Antoine Pitrou
75a3378810 bpo-40282: Allow random.getrandbits(0) (GH-19539) 2020-04-17 19:32:14 +02:00
Victor Stinner
9f5fe7910f bpo-40286: Add randbytes() method to random.Random (GH-19527)
Add random.randbytes() function and random.Random.randbytes()
method to generate random bytes.

Modify secrets.token_bytes() to use SystemRandom.randbytes()
rather than calling directly os.urandom().

Rename also genrand_int32() to genrand_uint32(), since it returns an
unsigned 32-bit integer, not a signed integer.

The _random module is now built with Py_BUILD_CORE_MODULE defined.
2020-04-17 19:05:35 +02:00
Julien Palard
58a4054760 Doc: Fix s/pseudo random/pseudo-random/ (GH-18289) 2020-01-31 10:50:14 +01:00
Raymond Hettinger
041d8b48a2 bpo-38881: choices() raises ValueError when all weights are zero (GH-17362) 2019-11-23 02:22:13 -08:00
Raymond Hettinger
d0cdeaab76 bpo-32554: Deprecate hashing arbitrary types in random.seed() (GH-15382) 2019-08-22 09:19:36 -07:00
Raymond Hettinger
8dbe563aa6 bpo-37624: Document weight assumptions for random.choices() (GH-14855) 2019-07-19 01:56:42 -07:00
Matthias Bussonnier
31e8d69bfe bpo-33783: Use proper class markup for random.Random docs (GHè7817)
Signed-off-by: Matthias Bussonnier <bussonniermatthias@gmail.com>
2019-04-16 18:47:11 +02:00
Raymond Hettinger
47d9987247 bpo-35904: Add statistics.fmean() (GH-11892) 2019-02-21 15:06:29 -08:00