Skip to content

Commit

Permalink
Retain backward compatibility. Enforce C order.
Browse files Browse the repository at this point in the history
  • Loading branch information
stefanv committed Sep 2, 2012
1 parent 942bdb2 commit bb0e4f3
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion numpy/lib/index_tricks.py
Original file line number Diff line number Diff line change
Expand Up @@ -534,11 +534,19 @@ class ndindex(object):
"""
def __init__(self, *shape):
x = as_strided(_nx.zeros(1), shape=shape, strides=_nx.zeros_like(shape))
self._it = _nx.nditer(x, flags=['multi_index'])
self._it = _nx.nditer(x, flags=['multi_index'], order='C')

def __iter__(self):
return self

def ndincr(self):
"""
Increment the multi-dimensional index by one.
This method is for backward compatibility only: do not use.
"""
self.next()

def next(self):
"""
Standard iterator method, updates the index and returns the index tuple.
Expand Down

0 comments on commit bb0e4f3

Please sign in to comment.