Author: Manuel Jacob
Branch: remove-remaining-smm
Changeset: r69379:bd2ba0a147bb
Date: 2014-02-25 03:44 +0100
http://bitbucket.org/pypy/pypy/changeset/bd2ba0a147bb/

Log:    Add missing complex.__rpow__.

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
@@ -569,6 +569,13 @@
             raise oefmt(space.w_OverflowError, "complex exponentiation")
         return w_p
 
+    @unwrap_spec(w_third_arg=WrappedDefault(None))
+    def descr_rpow(self, space, w_lhs, w_third_arg):
+        w_lhs = self._to_complex(space, w_lhs)
+        if w_lhs is None:
+            return space.w_NotImplemented
+        return w_lhs.descr_pow(space, self, w_third_arg)
+
     def descr_conjugate(self, space):
         """(A+Bj).conjugate() -> A-Bj"""
         return space.newcomplex(self.realval, -self.imagval)
@@ -629,6 +636,7 @@
     __divmod__ = interp2app(W_ComplexObject.descr_divmod),
     __rdivmod__ = interp2app(W_ComplexObject.descr_rdivmod),
     __pow__ = interp2app(W_ComplexObject.descr_pow),
+    __rpow__ = interp2app(W_ComplexObject.descr_rpow),
 
     conjugate = interp2app(W_ComplexObject.descr_conjugate),
 )
_______________________________________________
pypy-commit mailing list
[email protected]
https://mail.python.org/mailman/listinfo/pypy-commit

Reply via email to