[pypy-svn] pypy cmath: (lac, arigo)

arigo commits-noreply at bitbucket.org
Mon Jan 17 18:34:08 CET 2011


Author: Armin Rigo <arigo at tunes.org>
Branch: cmath
Changeset: r40800:ce006b675b81
Date: 2011-01-17 18:12 +0100
http://bitbucket.org/pypy/pypy/changeset/ce006b675b81/

Log:	(lac, arigo)

	Use space.unpackcomplex() here.

diff --git a/pypy/module/cmath/interp_cmath.py b/pypy/module/cmath/interp_cmath.py
--- a/pypy/module/cmath/interp_cmath.py
+++ b/pypy/module/cmath/interp_cmath.py
@@ -20,8 +20,7 @@
 
 def unaryfn(c_func):
     def wrapper(space, w_z):
-        x = space.float_w(space.getattr(w_z, space.wrap('real')))
-        y = space.float_w(space.getattr(w_z, space.wrap('imag')))
+        x, y = space.unpackcomplex(w_z)
         try:
             resx, resy = c_func(x, y)
         except ValueError:


More information about the Pypy-commit mailing list