[Python-Dev] PEP 469: Restoring the iterkeys/values/items() methods

Benjamin Peterson benjamin at python.org
Sat Apr 19 05:08:13 CEST 2014

On Fri, Apr 18, 2014, at 19:31, Nick Coghlan wrote:
> After spending some time talking to the folks at the PyCon Twisted
> sprints, they persuaded me that adding back the iterkeys/values/items
> methods for mapping objects would be a nice way to eliminate a key
> porting hassle for them (and likely others), without significantly
> increasing the complexity of Python 3.
> I personally put this one in the same category as PEP 414 - not
> particularly useful from a Python 3 perspective, but not really
> harmful either, and helpful enough from a transition perspective to be
> worth doing.

It doesn't seem to be widely known that Python 2.7's dict has
viewkeys()/viewvalues()/viewitems() methods which implement Python 3
dictionary views. Thus, an alternate (or concurrent) proposal could be
add these aliases to the Python 3 dictionary type. At any rate, the PEP
should mention these methods' existence.

More information about the Python-Dev mailing list