[issue19224] Make hash(None) consistent among processes

2013-10-12 Thread Christian Heimes
Christian Heimes added the comment: Tim has convinced me, too. -- ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe

[issue19224] Make hash(None) consistent among processes

2013-10-12 Thread Raymond Hettinger
Raymond Hettinger added the comment: There seems to be a pretty good consensus that this is something we don't want to support. -- resolution: -> rejected status: open -> closed ___ Python tracker ___

[issue19224] Make hash(None) consistent among processes

2013-10-11 Thread Tim Peters
Tim Peters added the comment: -0. Since hash(None) is currently based on None's memory address, I appreciate that it's not reliable (e.g., use different releases of the same compiler to build Python, and hash(None) may be different between them). The docs guarantee little about hash() results

[issue19224] Make hash(None) consistent among processes

2013-10-11 Thread STINNER Victor
STINNER Victor added the comment: "It's wired and make difficulty for distributed systems partitioning data according hash of keys if the system wants the keys support None." How you handle the randomization of hash(str)? (python2.7 -R, enabled by default in Python 3.3). -- _

[issue19224] Make hash(None) consistent among processes

2013-10-11 Thread STINNER Victor
STINNER Victor added the comment: In the same Python version, hash(None) always give me the same value. I cannot reproduced your issue on Linux, I tested Python 2.7, 3.3 and 3.4. $ python2.7 -c "print(hash(None))" 17171842026 $ python2.7 -c "print(hash(None))" 17171842026 $ python2.7 -c "print(

[issue19224] Make hash(None) consistent among processes

2013-10-11 Thread Antoine Pitrou
Antoine Pitrou added the comment: Is this something we actually want to support officially? Many other types have non-repeatable hashes, e.g.: $ PYTHONHASHSEED=1 python3 -c "print(hash((lambda: 0)))" 8771754605115 $ PYTHONHASHSEED=1 python3 -c "print(hash((lambda: 0)))" 8791504743739 $ PYTHONHA

[issue19224] Make hash(None) consistent among processes

2013-10-10 Thread Qiangning Hong
Qiangning Hong added the comment: Return 1315925605 now :) -- Added file: http://bugs.python.org/file32044/hash_of_none.patch ___ Python tracker ___ _

[issue19224] Make hash(None) consistent among processes

2013-10-10 Thread Christian Heimes
Christian Heimes added the comment: How about >>> (78 << 24) + (111 << 16) + (110 << 8) + 101 1315925605 The output of hash() is not guaranteed to be consistent between processes. The outcome depends on the hash randomization key, architecture, platform, Python version and perhaps other flags

[issue19224] Make hash(None) consistent among processes

2013-10-10 Thread Raymond Hettinger
Raymond Hettinger added the comment: Instead of 0, pick some large random number that is less likely to collide with other hashes such as hash(0). -- nosy: +rhettinger ___ Python tracker __

[issue19224] Make hash(None) consistent among processes

2013-10-10 Thread Qiangning Hong
New submission from Qiangning Hong: Integers, strings, and bool's hash are all consistent for processes of a same interpreter. However, hash(None) differs. $ python -c "print(hash(None))" 272931276 $ python -c "print(hash(None))" 277161420 It's wired and make difficulty for distributed system

[issue19224] Make hash(None) consistent among processes

2013-10-10 Thread Qiangning Hong
Changes by Qiangning Hong : -- keywords: +patch Added file: http://bugs.python.org/file32043/hash_of_none.patch ___ Python tracker ___ ___