]> granicus.if.org Git - python/commit
Fix for http://sourceforge.net/bugs/?func=detailbug&bug_id=111866&group_id=5470.
authorTim Peters <tim.peters@gmail.com>
Tue, 15 Aug 2000 03:34:48 +0000 (03:34 +0000)
committerTim Peters <tim.peters@gmail.com>
Tue, 15 Aug 2000 03:34:48 +0000 (03:34 +0000)
commit39dce29365d287dc6b353b2a527dc11fe58dcfa6
treef24a592be4c36c5d1888fb0881e8535bf023e41b
parent7aced17437a6b05bc4b0b5ff93aa6a5d3a374d68
Fix for http://sourceforge.net/bugs/?func=detailbug&bug_id=111866&group_id=5470.
This was a misleading bug -- the true "bug" was that hash(x) gave an error
return when x is an infinity.  Fixed that.  Added new Py_IS_INFINITY macro to
pyport.h.  Rearranged code to reduce growing duplication in hashing of float and
complex numbers, pushing Trent's earlier stab at that to a logical conclusion.
Fixed exceedingly rare bug where hashing of floats could return -1 even if there
wasn't an error (didn't waste time trying to construct a test case, it was simply
obvious from the code that it *could* happen).  Improved complex hash so that
hash(complex(x, y)) doesn't systematically equal hash(complex(y, x)) anymore.
Include/pyport.h
Objects/complexobject.c
Objects/floatobject.c
Objects/longobject.c
Objects/object.c