summaryrefslogtreecommitdiff
path: root/numpy/core/defmatrix.py
diff options
context:
space:
mode:
authorTravis Oliphant <oliphant@enthought.com>2008-05-13 16:44:03 +0000
committerTravis Oliphant <oliphant@enthought.com>2008-05-13 16:44:03 +0000
commitb316f21e0bd886c751db19ed8a1ff65b7adaa34b (patch)
tree3fcecd385e071808f094cb303ee2cd5d0b21cdd4 /numpy/core/defmatrix.py
parente3d0fec968a54a144de203a25d52e059b7447065 (diff)
downloadnumpy-b316f21e0bd886c751db19ed8a1ff65b7adaa34b.tar.gz
Back-out matrix changes from trunk. This breaks some test which need to be fixed differently.
Diffstat (limited to 'numpy/core/defmatrix.py')
-rw-r--r--numpy/core/defmatrix.py7
1 files changed, 5 insertions, 2 deletions
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