From b316f21e0bd886c751db19ed8a1ff65b7adaa34b Mon Sep 17 00:00:00 2001 From: Travis Oliphant Date: Tue, 13 May 2008 16:44:03 +0000 Subject: Back-out matrix changes from trunk. This breaks some test which need to be fixed differently. --- numpy/core/defmatrix.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'numpy/core/defmatrix.py') diff --git a/numpy/core/defmatrix.py b/numpy/core/defmatrix.py index 8ac75acf1..0c18dfb91 100644 --- a/numpy/core/defmatrix.py +++ b/numpy/core/defmatrix.py @@ -223,8 +223,6 @@ class matrix(N.ndarray): return def __getitem__(self, index): - if isscalar(index): - return self.__array__()[index] self._getitem = True try: @@ -304,6 +302,11 @@ class matrix(N.ndarray): else: raise ValueError, "unsupported axis" + # Necessary because base-class tolist expects dimension + # reduction by 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 -- cgit v1.2.1