Insertion order is a language guarantee, not an implementation accident.
Aditya Challa1 min read
Yes, Python dictionaries preserve insertion order, and the language has guaranteed it since Python 3.7. Iterating over a dict, or its keys, values and items, returns entries in the order they were first inserted.
Updating an existing key keeps its original position. Deleting a key and adding it again moves it to the end.
The Python docs note: "Changed in version 3.7: Dictionary order is guaranteed to be insertion order." CPython 3.6 already behaved this way as an implementation detail.
collections.OrderedDict still adds move_to_end() and treats order as significant when comparing two OrderedDicts for equality, which plain dicts do not.
Related: /blog/is-python-3-14-free-threaded-by-default
Related: /blog/what-does-if-name-main-do-in-python
Lab evidence
Facts in this draft were checked on 12 Oct 2026 against the primary sources listed in the body (official docs, release schedules or Google/YouTube help pages). No benchmarks or timings were run, so the post makes no performance or measurement claims; dates are quoted as published by the maintainers, and any estimate is labelled as such.
Explore the product
Freelancers and devs who want to turn coding skills into paid site builds
Hands-on math.fsum vs builtin sum for float totals: real items/s plus cancellation accuracy, measured on Linux localhost in this hands-on lab for SREs.
Summary1 Oct 20264 min read
Generators, lazily: what yield actually does to a function.
Summary12 Oct 20261 min read
Assignment expressions, explained with the examples that actually help.
Summary12 Oct 20261 min read