Message348265
> OrderedDict is not recommended to preserve order any more.
> Please forget about OrderedDict unless you need additional feature OrderedDict provides. It is far inefficient than regular dict.
Thanks for the clarification. Should this recommendation be briefly mentioned in the documentation (https://docs.python.org/3.9/library/collections.html#ordereddict-objects)?
Currently, the docs reference that as of 3.7, the order-preserving behavior of standard dictionaries is guaranteed, but there is no mention of the significant differences in efficiency. Based on the current description, a user might end up using OrderedDictionary on the basis that they *might* have a need for reordering elements.
If the difference in performance is significant enough, it would be worth noting in the docs so that users can take it into consideration when deciding which data structure to use. |
|
Date |
User |
Action |
Args |
2019-07-21 20:51:38 | aeros | set | recipients:
+ aeros, rhettinger, lebigot, methane, docs@python, Dima.Tisnek, josh.r |
2019-07-21 20:51:38 | aeros | set | messageid: <1563742298.26.0.117290296064.issue30550@roundup.psfhosted.org> |
2019-07-21 20:51:38 | aeros | link | issue30550 messages |
2019-07-21 20:51:37 | aeros | create | |
|