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

Serhiy Storchaka report at bugs.python.org
Sun Apr 14 02:17:54 EDT 2019


Serhiy Storchaka <storchaka+cpython at gmail.com> added the comment:

It the pure Python implementation PyDict_GetItem also
returns value, not node of linked list.

> How about raising DeprecationWarning when OrderedDict is passed to
PyDict_* APIs?

This would violate the Liskov substitution principle and add an overhead for using PyDict_* APIs with regular dicts.

----------

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


More information about the Python-bugs-list mailing list