[pypy-commit] pypy backend-vector-ops: remove an obscure parameter

fijal noreply at buildbot.pypy.org
Tue Feb 21 02:04:42 CET 2012


Author: Maciej Fijalkowski <fijall at gmail.com>
Branch: backend-vector-ops
Changeset: r52696:45ad7393f0ac
Date: 2012-02-20 18:04 -0700
http://bitbucket.org/pypy/pypy/changeset/45ad7393f0ac/

Log:	remove an obscure parameter

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
@@ -823,8 +823,8 @@
 class ToStringArray(Call1):
     def __init__(self, child):
         dtype = child.find_dtype()
-        self.itemsize = dtype.itemtype.get_element_size()
-        self.s = StringBuilder(child.size * self.itemsize)
+        itemsize = dtype.itemtype.get_element_size()
+        self.s = StringBuilder(child.size * itemsize)
         Call1.__init__(self, None, 'tostring', child.shape, dtype, dtype,
                        child)
         self.res = W_NDimArray([1], dtype, 'C')
diff --git a/pypy/module/micronumpy/signature.py b/pypy/module/micronumpy/signature.py
--- a/pypy/module/micronumpy/signature.py
+++ b/pypy/module/micronumpy/signature.py
@@ -335,7 +335,7 @@
         assert isinstance(arr, ToStringArray)
         arr.res.setitem(0, self.child.eval(frame, arr.values).convert_to(
             self.dtype))
-        for i in range(arr.itemsize):
+        for i in range(self.dtype.get_size()):
             arr.s.append(arr.res_casted[i])
 
 class BroadcastLeft(Call2):


More information about the pypy-commit mailing list