From d7ff9074fcde66225478d6721cf22b2db32dc2fd Mon Sep 17 00:00:00 2001 From: Pauli Virtanen Date: Sun, 10 Oct 2010 23:50:53 +0200 Subject: BUG: lib: clean up ancient-Python era stuff from IndexExpression (#1196) --- numpy/lib/index_tricks.py | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) (limited to 'numpy/lib/index_tricks.py') diff --git a/numpy/lib/index_tricks.py b/numpy/lib/index_tricks.py index eb1ab22e9..264ebaad0 100644 --- a/numpy/lib/index_tricks.py +++ b/numpy/lib/index_tricks.py @@ -700,24 +700,15 @@ class IndexExpression(object): array([2, 4]) """ - maxint = sys.maxint def __init__(self, maketuple): self.maketuple = maketuple def __getitem__(self, item): - if self.maketuple and type(item) != type(()): + if self.maketuple and type(item) != tuple: return (item,) else: return item - def __len__(self): - return self.maxint - - def __getslice__(self, start, stop): - if stop == self.maxint: - stop = None - return self[start:stop:None] - index_exp = IndexExpression(maketuple=True) s_ = IndexExpression(maketuple=False) -- cgit v1.2.1