|
|
|
|
|
by b_tterc_p
2737 days ago
|
|
Dicts now retain order now (in other words all dicts are ordered dicts). I support this, but I also guarantee this is going to bite me in the ass at least once sharing notebooks with someone on an older version of python as I expect to use this liberally. Ah well. |
|
As of Python 3.6, for the CPython implementation of Python, dictionaries remember the order of items inserted. This is considered an implementation detail in Python 3.6; you need to use OrderedDict if you want insertion ordering that's guaranteed across other implementations of Python.
As of Python 3.7, this is no longer an implementation detail and instead becomes a language feature.
[1] https://stackoverflow.com/questions/39980323/are-dictionarie...