<div dir="ltr"><div><div><div><div><div><div>Does everyone involved know that "for x in d.iterkeys()" is equivalent to "for x in d" and works the same in Python 2 and 3? Similarly, "list(d)" is a simple, fast way to spell the Python 2 semantics of "d.keys()"  that works in both versions (but I doubt it is much needed -- usually the actual code follows up with sorting, so you should use sorted(d)).<br>

<br></div>This doesn't solve itervalues() and iteritems() but I expect those are less common, and "for x, y in d.iteritems(): <blah>" is rewritten nicely as<br><br></div>  for x in d:<br></div>    y = d[x]<br>

</div>    <blah><br><br></div>If there is a measurable slowdown in the latter I would be totally okay with some kind of one-element cache for the most recent lookup.<br><br></div>I get the social aspect of the PEP, but I think it's too high a price to pay.<br clear="all">

<div><div><div><div><div><div><div><div><div class="gmail_extra"><br>-- <br>--Guido van Rossum (<a href="http://python.org/~guido">python.org/~guido</a>)
</div></div></div></div></div></div></div></div></div></div>