classification
Title: random.seed() relation to hash() function and its determinism is vague
Type: Stage:
Components: Documentation Versions: Python 3.7, Python 3.6, Python 3.3, Python 3.4, Python 3.5, Python 2.7
process
Status: closed Resolution: out of date
Dependencies: Superseder:
Assigned To: rhettinger Nosy List: abukaj, docs@python, rhettinger
Priority: low Keywords:

Created on 2016-12-20 13:07 by abukaj, last changed 2016-12-27 11:36 by rhettinger. This issue is now closed.

Messages (4)
msg283688 - (view) Author: Jakub Mateusz Dzik (abukaj) Date: 2016-12-20 13:07
2.7 (https://docs.python.org/2/library/random.html#random.seed)
- warning about PYTHONHASHSEED (environmental variable) voiding determinism
- no warning on -R interpreter switch 
- relation to hash() function omitted

2.6 (https://docs.python.org/2.6/library/random.html#random.seed)
3.0 (https://docs.python.org/3.0/library/random.html#random.seed)
3.1 (https://docs.python.org/3.1/library/random.html#random.seed)
3.2 (https://docs.python.org/3.2/library/random.html#random.seed)
3.3 (https://docs.python.org/3.3/library/random.html#random.seed)
3.4 (https://docs.python.org/3.4/library/random.html#random.seed)
- no warning about PYTHONHASHSEED nor -R switch
- relation to hash() function acknowledged

3.5 (https://docs.python.org/3.5/library/random.html#random.seed)
3.6 (https://docs.python.org/3.6/library/random.html#random.seed)
3.7 (https://docs.python.org/3.7/library/random.html#random.seed)
- no warning about PYTHONHASHSEED nor -R switch
- relation to hash() function omitted
msg283720 - (view) Author: Raymond Hettinger (rhettinger) * (Python committer) Date: 2016-12-21 06:41
In Python 3.5 and Python 3.6, this is already fixed (decoupled from PYTHONHASHSEED).  In Python 2.7, I could backport the fix, add a note to the docs, or just let it be (since seeding is turned off by default).  The other versions of Python are already inactive.
msg283744 - (view) Author: Jakub Mateusz Dzik (abukaj) Date: 2016-12-21 11:48
Python 2.7
I think note to the docs is enough.

Python 3.5+
I have a doubt. Isn't .seed(a, version=1) still coupled with PYTHONHASHSEED? The manual says version 1 is "reproducing random sequences from older versions of Python", and for 3.1 (and earlier) hash() is used, which (according to the manual) depends on PYTHONHASHSEED. Also, in Python 3.2-3.4 it is stated explicitly, that hash() is used.
msg284086 - (view) Author: Raymond Hettinger (rhettinger) * (Python committer) Date: 2016-12-27 11:36
This is out of date.
See http://bugs.python.org/issue27706
History
Date User Action Args
2016-12-27 11:36:53rhettingersetstatus: open -> closed
resolution: out of date
messages: + msg284086
2016-12-21 11:48:02abukajsetmessages: + msg283744
2016-12-21 06:41:35rhettingersetpriority: normal -> low

nosy: + rhettinger
messages: + msg283720

assignee: docs@python -> rhettinger
2016-12-20 13:07:17abukajcreate