From: Guido van Rossum [mailto:guido at python.org] >> 1. Add a plain irange() to itertools. >> 2. IF the general reversed() is deemed too theoretical, add EITHER a >> reverse argument to irange, or an irevrange to itertools. Both feel >> to me a little iffy, but that's my generality bias again. >> 3. IF the general reversed() is accepted (builtin or not) leave the >> irange function in its simple form. > Hm. reversed(irange(...)) can't work, so you'd have to have both. Raymond is proposing (in the PEP) a custom reverse via a __reversed__ special method. I'm assuming that irange() [and enumerate(), and possibly others] would need such a method, in order to cover just this case. >From my POV, having reversed(enumerate()) work is essential. Also for irange() if that is accepted. I've not looked through the other itertools, but a trawl through those to ensure any that need it have custom reverse methods would also be sensible. Paul.
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