frozendict

A simple immutable dictionary for Python

bacaro: haikuports also on HaikuPorts
Also on HaikuPorts. frozendict

Description

frozendict is a simple immutable dictionary. It's fast as dict, and sometimes faster!

Unlike other similar implementations, immutability is guaranteed: you can't change the internal variables of the class, and they are all immutable objects. Reinvoking __init__ does not alter the object.

The API is the same as dict, without methods that can change the immutability. So it supports also fromkeys, unlike other implementations. Furthermore it can be pickled, unpickled and have an hash, if all values are hashable.

You can also add any dict to a frozendict using the | operator. The result is a new frozendict.

Install

Channel stable v2.3.8-2

This app is curated in HaikuPorts. Install it from there, it is already available in HaikuDepot.

pkgman install frozendict

Download version 2.3.8-2 (any) hpkg

Careful: the file comes from HaikuPorts' own server, but installing it by hand is not the way in. It is pkgman that resolves the dependencies an .hpkg does not carry with it, and a package installed on its own may simply not run. Use the pkgman command above, unless you know exactly why you want the file.

Reviews