From: "Guido van Rossum" <[EMAIL PROTECTED]>
> But doesn't the very same argument also apply against islice(), which
> you just offered as an alternative?

Not really.  The use cases for islice() typically do not involve
repeated slices of an iterator unless it is slicing off the front
few elements on each pass.  In contrast, getitem() is all about
grabbing something other than the frontmost element and seems
to be intended for repeated calls on the same iterator.  And its
support for negative indices seems somewhat weird in the
context of general purpose iterators:  getitem(genprimes(), -1).

I'll study Walter's use case but my instincts say that adding
getitem() will do more harm than good.


Raymond
_______________________________________________
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com

Reply via email to