MagicStack/immutables
A high-performance immutable mapping type for Python.
▲ 1 hacker recommends C ★ 1.2k frozenhamtimmutableimmutable-collectionsimmutable-datastructurespython
Recommended between 2026-08-29 and 2026-08-29. Last pushed 2025-05-20.
▲ 1 recommend · ▼ 0 criticisms
What hackers say
“See also: https://github.com/MagicStack/immutables (for something you can actually use)”
— Retr0id, 2026-08-29 · original comment on Hacker News ↗
show original comment
It's not exposed for general use (yet?) but cpython does internally contain an implementation of the HAMT data structure: https://github.com/python/cpython/blob/main/Python/hamt.c Set/Delete/Lookup are all O(log(n)) See also: https://github.com/MagicStack/immutables (for something you can actually use) p.s. I think the reason heapq isn't a type is that it's ancient code that's hung around from the early days of python.
Badge for your README
[](https://hackerrepos.org/repo/magicstack/immutables)
Alternatives hackers mention
- python/cpython ▲ 1