[pypy-commit] pypy numpy-multidim: make test_zjit pass (up to the point anyway)

fijal noreply at buildbot.pypy.org
Fri Oct 28 19:08:30 CEST 2011


Author: Maciej Fijalkowski <fijall at gmail.com>
Branch: numpy-multidim
Changeset: r48581:488dbd72cd7b
Date: 2011-10-28 19:07 +0200
http://bitbucket.org/pypy/pypy/changeset/488dbd72cd7b/

Log:	make test_zjit pass (up to the point anyway)

diff --git a/pypy/module/micronumpy/compile.py b/pypy/module/micronumpy/compile.py
--- a/pypy/module/micronumpy/compile.py
+++ b/pypy/module/micronumpy/compile.py
@@ -28,6 +28,7 @@
 class FakeSpace(object):
     w_ValueError = None
     w_TypeError = None
+    w_IndexError = None
     w_None = None
 
     w_bool = "bool"
@@ -70,6 +71,7 @@
     def listview(self, obj):
         assert isinstance(obj, ListObject)
         return obj.items
+    fixedview = listview
 
     def float(self, w_obj):
         assert isinstance(w_obj, FloatObject)
diff --git a/pypy/module/micronumpy/interp_numarray.py b/pypy/module/micronumpy/interp_numarray.py
--- a/pypy/module/micronumpy/interp_numarray.py
+++ b/pypy/module/micronumpy/interp_numarray.py
@@ -63,12 +63,13 @@
     )
     arr = NDimArray(size, shape, dtype=dtype)
     i = 0
-    for i, w_elem in enumerate(elems_w):
+    for i in range(len(elems_w)):
+        w_elem = elems_w[i]
         dtype.setitem_w(space, arr.storage, i, w_elem)
     return arr
 
 class BaseArray(Wrappable):
-    _attrs_ = ["invalidates", "signature"]
+    _attrs_ = ["invalidates", "signature", "shape"]
 
     def __init__(self, shape):
         self.invalidates = []
@@ -406,7 +407,7 @@
     """
     signature = signature.BaseSignature()
 
-    _attrs_ = ["dtype", "value"]
+    _attrs_ = ["dtype", "value", "shape"]
 
     def __init__(self, dtype, value):
         BaseArray.__init__(self, [])
diff --git a/pypy/module/micronumpy/test/test_zjit.py b/pypy/module/micronumpy/test/test_zjit.py
--- a/pypy/module/micronumpy/test/test_zjit.py
+++ b/pypy/module/micronumpy/test/test_zjit.py
@@ -265,7 +265,7 @@
                 dtype = float64_dtype
             else:
                 dtype = int32_dtype
-            ar = SingleDimArray(n, dtype=dtype)
+            ar = NDimArray(n, [n], dtype=dtype)
             i = 0
             while i < n:
                 ar.get_concrete().setitem(i, int32_dtype.box(7))


More information about the pypy-commit mailing list