I'll let other people comment on this wrt Python (even though I think it looks cool and useful to me). Out of curiosity, why does frozenmap not have the same runtime and ordering guarantees as dict?
On Thursday, September 12, 2019 at 7:47:25 AM UTC-4, Yury Selivanov wrote:
I've just published a PEP to add a frozenmap type to Python; it should be online shortly.
Here's an excerpt from the Abstract:
A *persistent data structure* is defined as a data structure that preserves the previous version of the data when the data is modified. Such data structures are effectively *immutable*, as operations on them do not update the structure in-place, but instead always yield a new updated structure (see _ for more details.)
This PEP proposes to add a new fully persistent and immutable mapping type called ``frozenmap`` to the ``collections`` module.
The bulk of ``frozenmap``'s reference implementation is already used in CPython to implement the ``contextvars`` module.