[Python-3000] Iterators for dict keys, values, and items == annoying :)

Guido van Rossum guido at python.org
Fri Mar 24 16:22:44 CET 2006


On 3/24/06, Nick Coghlan <ncoghlan at gmail.com> wrote:
> Brett Cannon wrote:
> > On 3/23/06, Guido van Rossum <guido at python.org> wrote:
> >> (Off-topic: maybe we can drop the fall-back behavior
> >> of iter() if __iter__ isn't found?)
> >
> > I say yes.  Iterators will be common enough that objects that want the
> > support should just directly support it.
>
> Hmm, I'd expect the typical generator used for this to be a fair bit slower
> than the current custom sequence iterator:

But you wouldn't do that. You'd just rebuke the author of the
uniterable sequence type for not getting with the program after 7
years.

Some folks (not me) would like to make this a feature and remove the
__iter__ method on strings...

--
--Guido van Rossum (home page: http://www.python.org/~guido/)


More information about the Python-3000 mailing list