Greg Ewing wrote: > "Chermside, Michael" <mchermside at ingdirect.com>: > > >> >>> 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 at email.com | Mobile: +61 409 573 268
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4