Kyle Stanley <aeros...@gmail.com> added the comment:

> 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.

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue30550>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to