diff options
author | Travis Oliphant <oliphant@enthought.com> | 2006-09-14 03:52:21 +0000 |
---|---|---|
committer | Travis Oliphant <oliphant@enthought.com> | 2006-09-14 03:52:21 +0000 |
commit | 5a4affaf610cf183f50dfe63af1c35d210079385 (patch) | |
tree | fe1f29dede9181645592c99555ef0c847ced6fbe /numpy/lib/index_tricks.py | |
parent | 2ef6aa9fd13f335036fd7445f408eb0c334b9e46 (diff) | |
download | numpy-5a4affaf610cf183f50dfe63af1c35d210079385.tar.gz |
Don't deprecate c_. Use it as short-hand for a common case
Diffstat (limited to 'numpy/lib/index_tricks.py')
-rw-r--r-- | numpy/lib/index_tricks.py | 16 |
1 files changed, 7 insertions, 9 deletions
diff --git a/numpy/lib/index_tricks.py b/numpy/lib/index_tricks.py index 4040ac578..5d4886486 100644 --- a/numpy/lib/index_tricks.py +++ b/numpy/lib/index_tricks.py @@ -199,16 +199,18 @@ class concatenator(object): self.col = 0 return res - def __init__(self, axis=0, matrix=False): + def __init__(self, axis=0, matrix=False, ndmin=1, trans1d=-1): self._axis = axis self._matrix = matrix self.axis = axis self.matrix = matrix self.col = 0 + self.trans1d = trans1d + self.ndmin = ndmin def __getitem__(self,key): - trans1d = -1 - ndmin = 1 + trans1d = self.trans1d + ndmin = self.ndmin if isinstance(key, str): frame = sys._getframe().f_back mymat = matrix.bmat(key,frame.f_globals,frame.f_locals) @@ -320,14 +322,10 @@ import warnings class c_class(concatenator): """Translates slice objects to concatenation along the second axis. - This is deprecated. Use r_['-1',...] + This is equivalent to r_['-1,2,0',...] """ def __init__(self): - concatenator.__init__(self, -1) - - def __getitem__(self, obj): - warnings.warn("c_ is deprecated use r_['-1',...]") - return concatenator.__getitem__(self, obj) + concatenator.__init__(self, -1, ndmin=2, trans1d=0) c_ = c_class() |