[Python-Dev] Shall I start adding iterators to Python 2.2?
Aahz Maruch
aahz@rahul.net
Fri, 20 Apr 2001 10:08:53 -0700 (PDT)
Barry A. Warsaw wrote:
>
> Second, I'm still not totally comfortable with the "for keys:values in
> dict" part of the proposal, especially with the elaboration of letting
> either keys or values be missing. An alternative, which I sure has
> been raised, but which isn't in the PEP, is to allow an alternative
> pseudo-keyword in the `in' position. For example, allow "over" which
> has the semantics when used with a dict of iterating over keys.items()
> and when iterating over a sequence has the semantics of iterating over
> zip(range(len(a)), a). Thus only this would be allowed:
>
> for key, value over dict:
>
> for index, item over seq:
+1 from me, particularly the part about getting rid of "keys:values"; I
just see little advantage to using anything other than a tuple.
--
--- Aahz (@pobox.com)
Hugs and backrubs -- I break Rule 6 <*> http://www.rahul.net/aahz/
Androgynous poly kinky vanilla queer het Pythonista
I don't really mind a person having the last whine, but I do mind
someone else having the last self-righteous whine.