2 ms·
> something changed with dict enumeration order between python 2 and 3 Dicts were by definition unordered until Python 3.7 [0], so you were relying on undefine
by JimDabell 7y ago
> something changed with dict enumeration order between python 2 and 3
Dicts were by definition unordered until Python 3.7 [0], so you were relying on undefined behaviour. If you need an ordered dictionary and support Python 3.6 or below, you should use OrderedDict [1].
[0] https://mail.python.org/pipermail/python-dev/2017-December/151283.html https://mail.python.org/pipermail/python-dev/2017-December/1...
[1] https://docs.python.org/3/library/collections.html#collections.OrderedDict https://docs.python.org/3/library/collections.html#collectio...