Raymond Hettinger <python at rcn.com> wrote: > > FWIW, someone (Bengt Richter perhaps) once suggested syntactic support > differentiated from sequences but less awkward than a call to > itertools.islice(). > > itertools.islice(someseq, lo, hi) would be rendered as someseq'[lo:hi]. Just to make sure I'm reading this right, the difference between sequence slicing and iterator slicing is a single-quote? IMVHO, that's pretty hard to read... If we're really looking for a builtin, wouldn't it be better to go the route of getattr/setattr and have something like getslice that could operate on both lists and iterators? Then getslice(lst, lo, hi) would just be an alias for lst[lo:hi] and getslice(itr, lo, hi) would just be an alias for itertools.islice(itr, lo, hi) Steve -- You can wordify anything if you just verb it. --- Bucky Katt, Get Fuzzy
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