[issue32554] random seed is not consistent when using tuples with a str element

Johnny Dude report at bugs.python.org
Mon Jan 15 04:08:22 EST 2018


New submission from Johnny Dude <johnny.dude at gmail.com>:

When using a tuple that include a string the results are not consistent when invoking a new interpreter or process.

For example executing the following on a linux machine will yield different results:
python3.6 -c 'import random; random.seed(("a", 1)); print(random.random())"

Please note that the doc string of random.seed states: "Initialize internal state from hashable object."

Python documentation does not. (https://docs.python.org/3.6/library/random.html#random.seed)

This is very confusing, I hope you can fix the behavior, not the doc string.

----------
components: Extension Modules
messages: 309956
nosy: JohnnyD
priority: normal
severity: normal
status: open
title: random seed is not consistent when using tuples with a str element
type: behavior
versions: Python 3.6

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue32554>
_______________________________________


More information about the Python-bugs-list mailing list