File tree Expand file tree Collapse file tree 1 file changed +6
-4
lines changed Expand file tree Collapse file tree 1 file changed +6
-4
lines changed Original file line number Diff line number Diff line change @@ -1062,7 +1062,7 @@ def mask_indices(
10621062
10631063# pylint: disable=invalid-name
10641064# pylint: disable=too-few-public-methods
1065- class ndindex ( numpy . ndindex ) :
1065+ class ndindex :
10661066 """
10671067 An N-dimensional iterator object to index arrays.
10681068
@@ -1112,7 +1112,10 @@ class ndindex(numpy.ndindex):
11121112 """
11131113
11141114 def __init__ (self , * shape ):
1115- super ().__init__ (shape )
1115+ self .ndindex_ = numpy .ndindex (* shape )
1116+
1117+ def __iter__ (self ):
1118+ return self .ndindex_
11161119
11171120 def __next__ (self ):
11181121 """
@@ -1125,8 +1128,7 @@ def __next__(self):
11251128
11261129 """
11271130
1128- # pylint: disable=useless-parent-delegation
1129- return super ().__next__ ()
1131+ return self .ndindex_ .__next__ ()
11301132
11311133
11321134def nonzero (a ):
You can’t perform that action at this time.
0 commit comments