[pypy-commit] pypy numpy-multidim-shards: more rpythonization (and potential crash avoidance)

fijal noreply at buildbot.pypy.org
Sun Nov 20 11:24:17 CET 2011


Author: Maciej Fijalkowski <fijall at gmail.com>
Branch: numpy-multidim-shards
Changeset: r49573:3f7e25afec9d
Date: 2011-11-20 12:23 +0200
http://bitbucket.org/pypy/pypy/changeset/3f7e25afec9d/

Log:	more rpythonization (and potential crash avoidance)

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
@@ -471,10 +471,11 @@
         Multidimensional arrays/slices will span a number of lines,
         each line will begin with indent.
         '''
-        if self.size < 1:
+        size = self.find_size()
+        if size < 1:
             builder.append('[]')
             return
-        if self.size > 1000:
+        if size > 1000:
             #Once this goes True it does not go back to False for recursive calls
             use_ellipsis = True
         dtype = self.find_dtype()


More information about the pypy-commit mailing list