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

Ethan Furman ethan at stoneleaf.us
Mon Apr 21 17:23:42 CEST 2014


On 04/20/2014 10:39 PM, Nick Coghlan wrote:
> Lists as mutable snapshots
> --------------------------
>
[...]
>
> The semantic equivalent of these operations in Python 3 are
> ``list(d.keys())``, ``list(d.values())`` and ``list(d.iteritems())``.

Last item should be ``list(d.items())``.


> Iterator objects
> ----------------
>
[...]
>
> In Python 3, direct iteration over mappings works the same way as it does
> in Python 2. There are no method based equivalents - the semantic equivalents
> of ``d.itervalues()`` and ``d.iteritems()`` in Python 3 are
> ``iter(d.values())`` and ``iter(d.iteritems())``.


``iter(d.items())``.


Thanks again, Nick.

--
~Ethan~


More information about the Python-Dev mailing list