[Python-Dev] Adding start to enumerate()
Greg Ewing
greg.ewing at canterbury.ac.nz
Wed May 14 02:24:48 CEST 2008
Steven D'Aprano wrote:
> With iterators being such a fundamental part of Python these days,
> perhaps one day we'll see the functions in the itertools module become
> iterator methods
I hope not. The set of potential functions that operate
on iterators is open-ended, and there's no reason to
single out a particular subset and make them methods.
Also, it would force all iterators to inherit from a
common base class in order to support those methods,
which is not a Pythonic thing to do.
Strings are different, because (a) they're a concrete
class, and (b) string methods benefit from having
access to implementation details of the string.
--
Greg
More information about the Python-Dev
mailing list