[Python-Dev] Adding start to enumerate() (original) (raw)
Guido van Rossum guido at python.org
Wed May 14 00🔞44 CEST 2008
- Previous message: [Python-Dev] Adding start to enumerate()
- Next message: [Python-Dev] Adding start to enumerate()
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
On Tue, May 13, 2008 at 3:11 PM, Steven D'Aprano <steve at pearwood.info> 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, as happened with strings. But that's a discussion for another day.
Unlikely. Every method needs to be reimplemented for each type that is expected to support it. There are only two string types, so that's manageable. But there are many dozens of iterator types. Insisting on a common base class would be unpythonic. Plus, the functional approach makes it possible to treat various non-iterators (like sequences and other iterables) the same way.
-- --Guido van Rossum (home page: http://www.python.org/~guido/)
- Previous message: [Python-Dev] Adding start to enumerate()
- Next message: [Python-Dev] Adding start to enumerate()
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]