[issue22097] Linked list API for ordereddict

Antoine Pitrou report at bugs.python.org
Tue Jul 29 18:17:42 CEST 2014


Antoine Pitrou added the comment:

> This does not meet your requirement of supporting insert_after(x),
> its insert(x, before) requires to give a dllistnode.

Indeed it lacks that piece of prettiness in the API. And adding a mapping to allow lookups from item to node really means using a orderedset or ordereddict-like structure. Which is why I was proposing to reuse the existing infrastructure.

(note that I *cannot* reuse it from my own third-party class, since the necessary bits are all internal)

Still you may make the point that ordereddict is not appropriate, andorderedset would be better for this API. Raymond, would you support adding an orderedset to the collections module?

----------

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue22097>
_______________________________________


More information about the Python-bugs-list mailing list