Author: Maciej Fijalkowski <fij...@gmail.com> Branch: Changeset: r53775:3e15df923f1b Date: 2012-03-18 09:08 +0200 http://bitbucket.org/pypy/pypy/changeset/3e15df923f1b/
Log: fix hashing of complex object diff --git a/pypy/objspace/std/complexobject.py b/pypy/objspace/std/complexobject.py --- a/pypy/objspace/std/complexobject.py +++ b/pypy/objspace/std/complexobject.py @@ -9,6 +9,7 @@ from pypy.rlib.rfloat import ( formatd, DTSF_STR_PRECISION, isinf, isnan, copysign) from pypy.rlib import jit +from pypy.rlib.rarithmetic import intmask import math @@ -173,7 +174,7 @@ def hash__Complex(space, w_value): hashreal = _hash_float(space, w_value.realval) hashimg = _hash_float(space, w_value.imagval) - combined = hashreal + 1000003 * hashimg + combined = intmask(hashreal + 1000003 * hashimg) return space.newint(combined) def add__Complex_Complex(space, w_complex1, w_complex2): _______________________________________________ pypy-commit mailing list pypy-commit@python.org http://mail.python.org/mailman/listinfo/pypy-commit