I think pyrsistent uses the same data structure -- HAMT. Regardless of that, using it is a nonstarter because (a) we already use the bulk of frozenmap implementation to power the contextvars module; (b) pyrsistent is 15x slower, see https://gist.github.com/1st1/be5a1c10aceb0775d0406e879cf87344#gistcomment-30...
On Thu, Sep 12, 2019 at 3:52 PM Anders Hovmöller email@example.com wrote:
On 12 Sep 2019, at 13:46, Yury Selivanov firstname.lastname@example.org wrote:
I've just published a PEP to add a frozenmap type to Python; it should be online shortly.
My two cents: the motivation for "frozenmap" over "frozendict" isn't very compelling. In python we call them dicts. map() is a function. This is super confusing in other languages that have Map and map. Python doesn't have this problem. Let's not introduce it!
I would like some comparison and discussion of this data structure and its API compared to the corresponding data structure and API in pyrsistent if possible. (I am biased here because I've been involved a bit there and the author is a colleague but I think this is a relatively popular library for this use case...)