classification
Title: Results of random.seed() call with integer argument should be claimed deterministic.
Type: Stage:
Components: Documentation Versions: Python 2.7
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: rhettinger Nosy List: abukaj, docs@python, python-dev, rhettinger
Priority: low Keywords: patch

Created on 2016-12-20 12:46 by abukaj, last changed 2017-01-07 00:14 by rhettinger. 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
2017-01-07 00:14:13rhettingersetstatus: open -> closed
resolution: fixed
2017-01-07 00:13:53python-devsetnosy: + python-dev
messages: + msg284877
2017-01-05 09:03:06rhettingersetmessages: + msg284715
2017-01-05 09:02:25rhettingersetfiles: + random_docs.diff
keywords: + patch
2017-01-05 09:01:24rhettingersetmessages: - msg284677
2017-01-04 23:40:45rhettingersetpriority: normal -> low

nosy: + rhettinger
messages: + msg284677

assignee: docs@python -> rhettinger
2016-12-20 12:46:14abukajcreate