]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
Issue #789290: make sure that hash(2**63) == hash(2.**63) on 64-bit
authorMark Dickinson <dickinsm@gmail.com>
Sun, 8 Feb 2009 14:42:28 +0000 (14:42 +0000)
committerMark Dickinson <dickinsm@gmail.com>
Sun, 8 Feb 2009 14:42:28 +0000 (14:42 +0000)
commit10fe877dcd547befa3114e52f180bacf98e56098
tree8d838a1ebd8bf9034d6199a8042b8ad54914821b
parentc5e68b1898bde52ad8af73d21a8abd7461317302
Issue #789290: make sure that hash(2**63) == hash(2.**63) on 64-bit
platforms.  The previous code was fragile, depending on the twin
accidents that:

  (1) in C, casting the double value 2.**63 to long returns the integer
      value -2**63, and
  (2) in Python, hash(-2**63) == hash(2**63).

There's already a test for this in test_hash.
Objects/object.c