Author: Alex Gaynor <[email protected]>
Branch: numpy-complex
Changeset: r48089:78921804c629
Date: 2011-10-16 12:23 -0400
http://bitbucket.org/pypy/pypy/changeset/78921804c629/

Log:    enough to get tests passing, test_zjit blows up though

diff --git a/pypy/module/micronumpy/interp_dtype.py 
b/pypy/module/micronumpy/interp_dtype.py
--- a/pypy/module/micronumpy/interp_dtype.py
+++ b/pypy/module/micronumpy/interp_dtype.py
@@ -64,6 +64,9 @@
 
         def wrap(self, space):
             val = self.val
+
+            if valtype == (float, float):
+                return space.newcomplex(val[0], val[1])
             if valtype is rarithmetic.r_singlefloat:
                 val = float(val)
             return space.wrap(val)
@@ -101,7 +104,7 @@
             ))
 
         def getitem(self, storage, i):
-            return Box(self.unerase(storage)[i])
+            return self.box(self.unerase(storage)[i])
 
         def setitem(self, storage, i, item):
             self.unerase(storage)[i] = self.unbox(item)
@@ -505,6 +508,12 @@
         self.unerase(storage)[i].real = val[0]
         self.unerase(storage)[i].imag = val[1]
 
+    def getitem(self, storage, i):
+        return (
+            self.unerase(storage)[i].real,
+            self.unerase(storage)[i].imag,
+        )
+
 
 ALL_DTYPES = [
     W_BoolDtype,
_______________________________________________
pypy-commit mailing list
[email protected]
http://mail.python.org/mailman/listinfo/pypy-commit

Reply via email to