OSDir


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Python-Dev] Add __reversed__ methods for dict


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.