diff options
author | Sebastian Berg <sebastian@sipsolutions.net> | 2013-02-23 12:38:41 +0100 |
---|---|---|
committer | Sebastian Berg <sebastian@sipsolutions.net> | 2013-03-03 12:55:35 +0100 |
commit | 22e1fe48db411b28530e2b289d509abc35346e52 (patch) | |
tree | 89e14042fca3da9fd00af91c37cd285727961ebe /numpy/lib/index_tricks.py | |
parent | 610faef24ae57bfb9e9e7f95179e1e405f4c9f0d (diff) | |
download | numpy-22e1fe48db411b28530e2b289d509abc35346e52.tar.gz |
MAINT: Remove np.ndindex 0-d hack.
Diffstat (limited to 'numpy/lib/index_tricks.py')
-rw-r--r-- | numpy/lib/index_tricks.py | 25 |
1 files changed, 1 insertions, 24 deletions
diff --git a/numpy/lib/index_tricks.py b/numpy/lib/index_tricks.py index 9c58bf747..12b702fd0 100644 --- a/numpy/lib/index_tricks.py +++ b/numpy/lib/index_tricks.py @@ -532,30 +532,7 @@ class ndindex(object): (2, 0, 0) (2, 1, 0) - """ - # This is a hack to handle 0-d arrays correctly. - # Fixing nditer would be more work but should be done eventually, - # and then this entire __new__ method can be removed. - def __new__(cls, *shape): - if len(shape) == 1 and isinstance(shape[0], tuple): - shape = shape[0] - if len(shape) == 0: - class zero_dim_iter(object): - def __init__(self): - self._N = 1 - def __iter__(self): - return self - def ndincr(self): - self.next() - def next(self): - if self._N > 0: - self._N -= 1 - return () - raise StopIteration - return zero_dim_iter() - else: - return super(ndindex, cls).__new__(cls) - + """ def __init__(self, *shape): if len(shape) == 1 and isinstance(shape[0], tuple): shape = shape[0] |