Hash of None varies per-machine
Peter Pearson
ppearson at nowhere.invalid
Sat Apr 4 14:09:38 EDT 2009
On 03 Apr 2009 10:57:05 -0700, Paul Rubin <http> wrote:
> ben.taylor at email.com writes:
>> 1. Is it correct that if you hash two things that are not equal they
>> might give you the same hash value?
>
> Yes, hashes are 32 bit numbers and there are far more than 2**32
> possible Python values (think of long ints), so obviously there must
> be multiple values that hash to the same slot.
For example, on this machine:
Python 2.5.2 (r252:60911, Jul 31 2008, 17:28:52)
[GCC 4.2.3 (Ubuntu 4.2.3-2ubuntu7)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>>> hash( "latox" ) == hash( "uzyky" )
True
YMMV.
--
To email me, substitute nowhere->spamcop, invalid->net.
More information about the Python-list
mailing list