On Tue, May 13, 2008 at 3:11 PM, Steven D'Aprano <[EMAIL PROTECTED]> 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/)
_______________________________________________
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