[Numpy-svn] r5159 - branches/1.1.x/numpy/core

numpy-svn at scipy.org numpy-svn at scipy.org
Mon May 12 23:54:31 EDT 2008


Author: oliphant
Date: 2008-05-12 22:54:30 -0500 (Mon, 12 May 2008)
New Revision: 5159

Modified:
   branches/1.1.x/numpy/core/defmatrix.py
Log:
Back out scalar indexing change for 1.1 matrices.

Modified: branches/1.1.x/numpy/core/defmatrix.py
===================================================================
--- branches/1.1.x/numpy/core/defmatrix.py	2008-05-12 21:58:48 UTC (rev 5158)
+++ branches/1.1.x/numpy/core/defmatrix.py	2008-05-13 03:54:30 UTC (rev 5159)
@@ -223,8 +223,6 @@
         return
 
     def __getitem__(self, index):
-        if isscalar(index):
-            return self.__array__()[index]
         self._getitem = True
 
         try:
@@ -304,6 +302,10 @@
         else:
             raise ValueError, "unsupported axis"
 
+    # To overcome dimension non-reduction of x[0]
+    def tolist(self):
+        return self.__array__().tolist()
+
     # To preserve orientation of result...
     def sum(self, axis=None, dtype=None, out=None):
         """Sum the matrix over the given axis.  If the axis is None, sum




More information about the Numpy-svn mailing list