> > > for i, value in reversed(enumerate(listofnum)): > > > > Sorry, this doesn't work. enumerate() returns an iterator, reversed() > > requires a sequence. > > I believe the assumption is that enumerate (as well as the proposed irange) > would grow an __reversed__ method to handle just that usage. Ah, so it is. Then the PEP's abstract is wrong: """ This proposal is to add a builtin function to support reverse iteration over sequences. """ Also, the PEP should enumerate (:-) which built-in types should be modified in this way, to give an impression of the enormity (or not) of the task. --Guido van Rossum (home page: http://www.python.org/~guido/)
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