3 ms·
Ordered dicts and f-strings are also very sweet!
by sametmax 7y ago
Ordered dicts and f-strings are also very sweet!
- GeorgeTirebiter 7y agoAnd optional type specifiers. This was the key for me.
- loeg 7y agohttps://docs.python.org/2/library/collections.html#collections.OrderedDict https://docs.python.org/2/library/collections.html#collectio...
- price 7y agoI expect sametmax was referring to the new feature in Python 3.6 that plain old `dict` now preserves the insertion order of its elements. See docs here: https://docs.python.org/3/library/stdtypes.html#dict.values https://docs.python.org/3/library/stdtypes.html#dict.values (Or in language-lawyer terms: CPython 3.6 introduced this behavior and documented it as an implementation detail, and for Python 3.7+ it's guaranteed a feature of the language proper.)