summaryrefslogtreecommitdiff
path: root/numpy/core/defmatrix.py
diff options
context:
space:
mode:
Diffstat (limited to 'numpy/core/defmatrix.py')
-rw-r--r--numpy/core/defmatrix.py2
1 files changed, 2 insertions, 0 deletions
diff --git a/numpy/core/defmatrix.py b/numpy/core/defmatrix.py
index bfcb68364..441500c90 100644
--- a/numpy/core/defmatrix.py
+++ b/numpy/core/defmatrix.py
@@ -122,6 +122,8 @@ class matrix(N.ndarray):
def __getitem__(self, index):
out = N.ndarray.__getitem__(self, index)
+ if not isinstance(out, matrix):
+ return out
# Need to swap if slice is on first index
# or there is an integer on the second
retscal = False