Antoine Pitrou <pit...@free.fr> added the comment:

Well, ideally we should drop the automatic hash() and only accept:
1) ints/longs
2) buffer-like objects

(and tell people to hash() explicitly if they want to)

If that's too disruptive, we should document it.
And, for 3.x, provide the following recipe to hash from a bytes object without 
losing entropy, and keeping the same results under 32-bit and 64-bit builds:

>>> import random
>>> random.seed(int.from_bytes(b'foo', 'little'))
>>> random.random()
0.08384169414918807

----------
versions: +Python 2.6, Python 2.7, Python 3.2

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue7889>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to