Issue 29023: Results of random.seed() call with integer argument should be claimed deterministic. (original) (raw)

Issue29023

Created on 2016-12-20 12:46 by abukaj, last changed 2022-04-11 14:58 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
random_docs.diff rhettinger,2017-01-05 09:02 Simplify, improve and sync docstrings with main docs for random
Messages (3)
msg283686 - (view) Author: Jakub Mateusz Dzik (abukaj) Date: 2016-12-20 12:46
In https://docs.python.org/2/library/random.html#random.seed I can find that "If a hashable object is given, deterministic results are only assured when PYTHONHASHSEED is disabled." Both int and long are hashable. However, tests on the random module as well as C source code of random_seed (as indicated in http://stackoverflow.com/a/41228062/4879688) suggest that behaviour of the module is deterministic when seeded with an integer.
msg284715 - (view) Author: Raymond Hettinger (rhettinger) * (Python committer) Date: 2017-01-05 09:03
Attached patch simplifies, improves, and syncs the main docs with the docstrings.
msg284877 - (view) Author: Roundup Robot (python-dev) (Python triager) Date: 2017-01-07 00:13
New changeset 7d6ebd206cd6 by Raymond Hettinger in branch '2.7': Issue #29023: Clarify that ints and longs are always deterministic seeds for random. https://hg.python.org/cpython/rev/7d6ebd206cd6
History
Date User Action Args
2022-04-11 14:58:40 admin set github: 73209
2017-01-07 00:14:13 rhettinger set status: open -> closedresolution: fixed
2017-01-07 00:13:53 python-dev set nosy: + python-devmessages: +
2017-01-05 09:03:06 rhettinger set messages: +
2017-01-05 09:02:25 rhettinger set files: + random_docs.diffkeywords: + patch
2017-01-05 09:01:24 rhettinger set messages: -
2017-01-04 23:40:45 rhettinger set priority: normal -> lownosy: + rhettingermessages: + assignee: docs@python -> rhettinger
2016-12-20 12:46:14 abukaj create