catalyst
catalyst copied to clipboard
Documentation: Dictionary Ordering in Python
Minor nitpick in our documentation for catalyst.pipeline which says
Note: As of Python 3.7, the CPython dictionary implementation orders dictionaries based on insertion order. However, for an API guarantee of dictionary order, collections.OrderedDict may also be used.
Actually as of Python 3.7 this is part of the Python standard, all compliant interpreters/compilers should preserve insertion order (as of 3.6 it was merely a CPython implementation detail). The official docs confirm this:
Dictionaries preserve insertion order. Note that updating a key does not affect the order. Keys added after deletion are inserted at the end. Changed in version 3.7: Dictionary order is guaranteed to be insertion order. This behavior was an implementation detail of CPython from 3.6.