--- defmatrix.old Sat Apr 26 09:34:11 2008 +++ defmatrix.py Sat Apr 26 09:37:13 2008 @@ -1,6 +1,7 @@ __all__ = ['matrix', 'bmat', 'mat', 'asmatrix'] import sys +import warnings import numeric as N from numeric import concatenate, isscalar, binary_repr @@ -119,6 +120,9 @@ return def __getitem__(self, index): + if isscalar(index): + warnings.warn("scalar indexing of matrices is deprecated, use x[i,:] instead", + DeprecationWarning, stacklevel=2) self._getitem = True try: out = N.ndarray.__getitem__(self, index)