[issue7889] random produces different output on different architectures

Mark Dickinson report at bugs.python.org
Tue Feb 9 13:02:35 CET 2010


Mark Dickinson <dickinsm at gmail.com> added the comment:

[Antoine]
> >>> random.seed(int.from_bytes(b'foo', 'little'))

+1 for either documenting this useful trick, or modifying init_by_array to do this automatically for buffer-like objects.

Disallowing other types of input for the seed sounds dangerous, though.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue7889>
_______________________________________


More information about the Python-bugs-list mailing list