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)). 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 for x in d: y = d[x] <blah> 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. I get the social aspect of the PEP, but I think it's too high a price to pay. -- --Guido van Rossum (python.org/~guido) -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://mail.python.org/pipermail/python-dev/attachments/20140419/dec2082b/attachment.html>
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4