This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author methane
Recipients eric.snow, methane, rhettinger, serhiy.storchaka, tim.peters
Date 2019-04-15.23:11:52
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1555369912.71.0.0405615227926.issue31954@roundup.psfhosted.org>
In-reply-to
Content
@Serhiy

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

I missed pure Python implementation used two dicts.


@Eric

> Please don't miss the fact that the main reason for mirroring the dict table is to get O(1) node lookup (in the linked list). 

I don't miss it, of course.  I'm proposing make linked list node as Python Object, and store it directly into dict, like LRU implementation in _functools.

In this idea, if dict.__getitem__ is called directly, a node of linked list is returned instead of value in the node.
I must admit this idea is too aggressive.

If we can redesign OrderedDict from scratch, I propose OrderedDict uses dict, without inheriting it.  But it is too late.
History
Date User Action Args
2019-04-15 23:11:52methanesetrecipients: + methane, tim.peters, rhettinger, eric.snow, serhiy.storchaka
2019-04-15 23:11:52methanesetmessageid: <1555369912.71.0.0405615227926.issue31954@roundup.psfhosted.org>
2019-04-15 23:11:52methanelinkissue31954 messages
2019-04-15 23:11:52methanecreate