Re:Comprehensive Python Cheatsheet (2018)
by bhrgunatha on Monday February 04, 2019 @07:49AM
(#19075871)
I love that talk. Raymond Hettinger is a gem. What I took from that is the implementation does preserve order but it isn't guaranteed yet and in theory it could change.
[ Parent
| on HN ]
Re:Comprehensive Python Cheatsheet (2018)
by StreakyCobra on Monday February 04, 2019 @07:57AM
(#19075921)
> I love that talk. Raymond Hettinger is a gem.
This talk is definitely worth a watch yes :)
> What I took from that is the implementation does preserve order but it isn't guaranteed yet and in theory it could change.
This was the case for python 3.6, but starting from Python 3.7 ordering is guaranteed [1]:
Changed in version 3.7: Dictionary order is guaranteed to be insertion order.
[1] https://docs.python.org/3.7/library/stdtypes.html#dict-views