[issue31954] Don't prevent dict optimization by coupling with OrderedDict

Inada Naoki report at bugs.python.org
Sun Apr 14 01:57:56 EDT 2019


Inada Naoki <songofacandy at gmail.com> added the comment:

There are some more aggressive ideas.

When Eric created C version of OrderedDict, he intended to use it
for PEP 468.  Unlike pure Python implementation, PyDict_GetItem
returns value, not node of linked list.

But now, PEP 468 is implemented in regular dict.
How about raising DeprecationWarning when OrderedDict is passed to
PyDict_* APIs?

LRU implementation of functools is much more efficient than OrderedDict.
OrderedDict can be achieve same performance and efficiency when
node of linked list is stored in underlaying dict.

----------
nosy: +eric.snow

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue31954>
_______________________________________


More information about the Python-bugs-list mailing list