[Python-Dev] Re: Make HAMT available to python script

2022-04-02 Thread zhang kai
> > All of that kind of adds up to make it a distraction that's likely worse > than a dict subclass with __setitem__ overridden (if that's the > behaviour you want). It's a fantastic data structure for when you need > it, but it's one that deserves to be researched and understood before > simply dr

[Python-Dev] Re: Make HAMT available to python script

2022-04-01 Thread zhang kai
11:48 AM, zhang kai wrote: > > Thanks Victor and Pablo. I will check the discussion of PEP 603. It's a > > little weird to use the immutables library when it's code in already in > > CPython but I'm glad it's an option. > > The main difference is that 'imm

[Python-Dev] Re: Make HAMT available to python script

2022-04-01 Thread zhang kai
PEP 603, which more or less proposes this (the > author of the pep is the author of the HAMT code) > check https://peps.python.org/pep-0603/ > > Alternatively, there is already a pypi package with this code: > > https://pypi.org/project/immutables/ > > Regards from cloudy Lond

[Python-Dev] Make HAMT available to python script

2022-04-01 Thread zhang kai
Hi, HAMT is a very useful immutable mapping type. Currently CPython use it internally to implement contextvar. Considering immutable data structure is very useful I hope we can make it available to python script(maybe via collections module). Immutable data structures are fundamental parts of