[pypy-svn] r15930 - pypy/dist/pypy/objspace/std
pedronis at codespeak.net
pedronis at codespeak.net
Wed Aug 10 18:34:24 CEST 2005
Author: pedronis
Date: Wed Aug 10 18:34:22 2005
New Revision: 15930
Modified:
pypy/dist/pypy/objspace/std/floatobject.py
Log:
issue91 in-progress
the rest of the code seems code, but in pow we need to decide how to distribute the work between
code here and the backend implementation
Modified: pypy/dist/pypy/objspace/std/floatobject.py
==============================================================================
--- pypy/dist/pypy/objspace/std/floatobject.py (original)
+++ pypy/dist/pypy/objspace/std/floatobject.py Wed Aug 10 18:34:22 2005
@@ -271,6 +271,8 @@
return space.newtuple(_divmod_w(space, w_float1, w_float2))
def pow__Float_Float_ANY(space, w_float1, w_float2, thirdArg):
+ # XXX it makes sense to do more here than in the backend
+ # about sorting out errors!
if not space.is_w(thirdArg, space.w_None):
raise FailedToImplement(space.w_TypeError, space.wrap(
"pow() 3rd argument not allowed unless all arguments are integers"))
@@ -281,9 +283,10 @@
except OverflowError:
raise FailedToImplement(space.w_OverflowError, space.wrap("float power"))
except ValueError, e:
- raise FailedToImplement(space.w_ValueError, space.wrap(str(e)))
- except ZeroDivisionError, e: # (0.0 ** -1)
- raise OperationError(space.w_ZeroDivisionError, space.wrap(str(e)))
+ raise FailedToImplement(space.w_ValueError, space.wrap(str(e))) # xxx
+ except ZeroDivisionError, e:
+ raise OperationError(space.w_ZeroDivisionError,
+ space.wrap("0.0 cannot be raised to a negative power"))
return W_FloatObject(space, z)
More information about the Pypy-commit
mailing list