Steven D'Aprano wrote:
[snip]
I'm sympathetic to your concern: I've often felt offended that doing
something like this:
x = SomeReallyBigListOrString
for item in x[1:]:
process(item)
has to copy the entire list or string (less the first item). But
honestly, I've never found a situation where it actually mattered.
[snip]
Could lists gain an .items() method with start and end positions? I was
thinking that it would be a 'view', like with dicts in Python 3. Of
course, that would only be worthwhile with very long lists:
x = SomeReallyBigListOrString
for item in x.items(1):
process(item)
--
http://mail.python.org/mailman/listinfo/python-list