Existe-t-il une alternative moins verbeuse à ceci:
for x in xrange(array.shape[0]):
for y in xrange(array.shape[1]):
do_stuff(x, y)
Je suis venu avec ceci:
for x, y in itertools.product(map(xrange, array.shape)):
do_stuff(x, y)
Ce qui sauve une indentation, mais reste quand même assez moche.
J'espère quelque chose qui ressemble à ce pseudocode:
for x, y in array.indices:
do_stuff(x, y)
Est-ce que quelque chose comme ça existe?