[pypy-svn] r23148 - pypy/dist/pypy/objspace/std
cfbolz at codespeak.net
cfbolz at codespeak.net
Wed Feb 8 18:01:50 CET 2006
Author: cfbolz
Date: Wed Feb 8 18:01:48 2006
New Revision: 23148
Modified:
pypy/dist/pypy/objspace/std/complexobject.py
Log:
small typos + mixing wrapped and regular ints in hash__Complex
Modified: pypy/dist/pypy/objspace/std/complexobject.py
==============================================================================
--- pypy/dist/pypy/objspace/std/complexobject.py (original)
+++ pypy/dist/pypy/objspace/std/complexobject.py Wed Feb 8 18:01:48 2006
@@ -133,10 +133,10 @@
hashreal = _hash_float(space, w_value._real)
if hashreal == -1:
- return -1
+ return space.newint(-1)
hashimg = _hash_float(space, w_value._imag)
if hashimg == -1:
- return -1
+ return space.newint(-1)
combined = hashreal + 1000003 * hashimg
if (combined == -1):
combined = -2
@@ -196,7 +196,7 @@
def pow__Complex_Complex_ANY(space, w_complex1, w_complex2, thirdArg):
if not isinstance(thirdArg, W_NoneObject):
- raise poso.OperationError(space.w_ValueError, space.wrap('complex module'))
+ raise poso.OperationError(space.w_ValueError, space.wrap('complex modulo'))
try:
v = _w2t(w_complex1)
exponent = _w2t(w_complex2)
@@ -218,7 +218,7 @@
return W_ComplexObject(space, w_complex._real, w_complex._imag)
def abs__Complex(space, w_complex):
- return space.wrap(math.hypot(w_complex._real, w_complex._imag))
+ return space.newfloat(math.hypot(w_complex._real, w_complex._imag))
def eq__Complex_Complex(space, w_complex1, w_complex2):
return space.newbool((w_complex1._real == w_complex2._real) and
More information about the Pypy-commit
mailing list