[issue27742] Random.randint generates different values in Python2 and Python3

2016-08-12 Thread SilentGhost
Changes by SilentGhost : -- stage: -> resolved ___ Python tracker ___ ___

[issue27742] Random.randint generates different values in Python2 and Python3

2016-08-12 Thread Raymond Hettinger
Raymond Hettinger added the comment: Wolfgang, sorry you bumped into this problem and glad that you have a workaround. We only guarantee availability of backward compatible seeders and that calls to random() are reproducible. The other methods are allowed to change so that we can make

[issue27742] Random.randint generates different values in Python2 and Python3

2016-08-12 Thread Antti Haapala
Antti Haapala added the comment: Anyhow, in this case it is easy to simulate the Python 2 randint behaviour (add checks for hi >= lo if needed): >>> random.seed(5, version=1) >>> randint_compat = lambda lo, hi: lo + int(random.random() * (hi + 1 - lo)) >>> randint_compat(0,

[issue27742] Random.randint generates different values in Python2 and Python3

2016-08-12 Thread Wolfgang Rohdewald
Wolfgang Rohdewald added the comment: @SilentGhost: Sorry, I did not see the latest messages, I was referring to msg272511 Having to re-implement everything but rnd.random is not very user friendly. I will do that now for my project. -- ___ Python

[issue27742] Random.randint generates different values in Python2 and Python3

2016-08-12 Thread SilentGhost
SilentGhost added the comment: > There seems to be more to it I'm not sure what "it" are you referring to. The output of randint is not guaranteed to be the same across versions, the seeded sequence is still the same between python2 and 3 - as documented. -- title: Random.seed(5,