1 Jul
2004
1 Jul
'04
4:24 a.m.
Greg Ewing wrote:
"Chermside, Michael"
: for i in len(myList): ... doSomethingWithIndexes(i)
is simple and elegant.
IMO it would be clearer, and equally elegant, to write this as something like
for i in indices(myList): ...
which is easily accomplished with the aid of a suitable definition for indices(). No language changes needed.
And I believe most of those use cases are better covered by enumerate() anyway. Interesting that in the course of this discussion I've gone from 'nice idea' to 'no way!' Cheers, Nick. -- Nick Coghlan | Brisbane, Australia Email: ncoghlan@email.com | Mobile: +61 409 573 268