[Python-Dev] Add __reversed__ methods for dict

Armin Rigo armin.rigo at gmail.com
Sat Jun 2 16:20:33 EDT 2018


Hi Inada,

On 27 May 2018 at 09:12, INADA Naoki <songofacandy at gmail.com> wrote:
> When focusing to CPython, PyPy and MicroPython, no problem for adding
> __reverse__ in 3.8 seems OK.

Fwiw, the functionality that is present in OrderedDict but still
absent from 'dict' is: ``__reverse__``, discussed above, and
``move_to_end(last=False)``.  In PyPy3, OrderedDict is implemented not
like in the CPython stdlib but as just a thin dict subclass without
any extra data, using two custom built-ins from the ``__pypy__``
module for the two methods above (plus some pure Python code for other
methods like __eq__(), where it is possible to do so with the correct
complexity).


A bientôt,

Armin.


More information about the Python-Dev mailing list