On Thu, 31 Jan 2019 at 15:46, Raymond Hettinger <raymond.hettinger at gmail.com> wrote: > > > Would it be practical to add deprecated methods to regular dict for the > OrderedDict reordering methods that raise with an error suggesting "To use > this method, convert dict to OrderedDict." (or some better wording). > > That's an interesting idea. Regular dicts aren't well suited to the > reordering operations (like lists, repeated inserts at the front of the > sequence wouldn't be performant relative to OrderedDict which uses > double-linked lists internally). My instinct is to leave regular dicts > alone so that they can focus on their primary task (being good a fast > lookups). > Alternatively, would it be viable to make OrderedDict work in a way that so long as you don't use any reordering operations it's essentially just a very thin layer on top of a dict, but if you do use any reordering operations, it adds in the additional heavyweight structure required to support that? I'm pretty sure something similar has been considered before, but thought I should bring it up in the context of this discussion (if only to have to shot down). Tim Delaney -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://mail.python.org/pipermail/python-dev/attachments/20190131/638e4270/attachment.html>
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4