Guido van Rossum wrote: > Iterators are for single sequential access. It's a feature that you > have to import itertools (or at least that you have to invoke its > special operations) -- iterators are not sequences and shouldn't be > confused with such. > I agree the semantic difference between an iterable and an iterator is important, but I am unclear on why that needs to translate to a syntactic difference for slicing, when it doesn't translate to such a difference for iteration (despite the *major* difference in the effect upon the object that is iterated over). Are the semantics of slicing really that much more exact than those for iteration? Also, would it make a difference if the ability to extract an individual item from an iterator through subscripting was disallowed? (i.e. getting the second item of an iterator being spelt "itr[2:3].next()" instead of "itr[2]") Regards, Nick. -- Nick Coghlan | ncoghlan at email.com | Brisbane, Australia --------------------------------------------------------------- http://boredomandlaziness.skystorm.net
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