python-dev summary, July 16-31

Just van Rossum just at letterror.com
Tue Aug 7 16:36:44 EDT 2001


Carel Fellinger wrote:

> Not paying attention to the headers, I first replied to c.l.py.a to
> have my posting sent of to some moderator. So let me retry in case the
> other doesn't make it into c.l.py.
> 
> Andrew Kuchling <akuchlin at mems-exchange.org> wrote:
> ...
> > As usual I'm writing up an explanation of the changes in 2.2:
> >       http://www.amk.ca/python/2.2/
> 
> Thanks for making such nice overviews, I always check them out to see
> how beatifull the next Python is going to be.
> 
> But on this explanatory page I was a bit surprised in your treatment of
> the iter protocol regarding dictionaries. It lumbed together both uses
> of in, the __contains__() version and the next() one.  The fact that
> "key in dict" is now equivalent to "dict.has_key(key)" has nothing to
> do with the iterability of dicts, at least that's what I've understood
> sofar.

But there has always been a nice symmetry between "if x in y" and
"for x in y", so it is much nicer to have "if key in dict" if you
*also* have "for key in dict". While the implementations have indeed
little in common, I think it's a little unfair to say they have
nothing to do with each other.

Just



More information about the Python-list mailing list