[pypy-commit] pypy refactor-signature: clean up descr_len

fijal noreply at buildbot.pypy.org
Sat Dec 17 14:27:31 CET 2011


Author: Maciej Fijalkowski <fijall at gmail.com>
Branch: refactor-signature
Changeset: r50613:e3cef40afa0d
Date: 2011-12-17 15:27 +0200
http://bitbucket.org/pypy/pypy/changeset/e3cef40afa0d/

Log:	clean up descr_len

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
@@ -394,7 +394,10 @@
         return self.get_concrete().copy()
 
     def descr_len(self, space):
-        return self.get_concrete().descr_len(space)
+        if len(self.shape):
+            return space.wrap(self.shape[0])
+        raise OperationError(space.w_TypeError, space.wrap(
+            "len() of unsized object"))
 
     def descr_repr(self, space):
         res = StringBuilder()
@@ -931,11 +934,6 @@
         # This is currently not possible to be called from anywhere.
         raise NotImplementedError
 
-    def descr_len(self, space):
-        if self.shape:
-            return space.wrap(self.shape[0])
-        return space.wrap(1)
-
     def setshape(self, space, new_shape):
         if len(self.shape) < 1:
             return
@@ -1059,12 +1057,6 @@
         )
         return array
 
-    def descr_len(self, space):
-        if len(self.shape):
-            return space.wrap(self.shape[0])
-        raise OperationError(space.w_TypeError, space.wrap(
-            "len() of unsized object"))
-
     def setitem_w(self, space, item, w_value):
         return self.setitem(item, self.dtype.coerce(space, w_value))
 


More information about the pypy-commit mailing list