Skip to main content

Package frozenmap provide FrozenDict and FrozenMap class

Project description

frozenmap is MIT Licensed python library. It implements FrozenDict and FrozenMap classes.

  • FrozenMap instance is an immutable mapping object wrapped around a mutable mapping object.

  • FrozenDict instance is an immutable mapping object wrapped around a dict object.

This library actually is a “proof of concept” for the problem of fast “immutable dict” problem.

Main repository for frozenmap is on bitbucket.

Quick start:

First load inventory:

>>> from frozenmap import FrozenDict

Simple example:

>>> fd = FrozenDict(a=1,b=2,c=3)
>>> print(fp)
FrozenDict({'a':1, 'b':2, 'c':3})
>>> fd['a']
1
>>> fd['a'] = 10
........
TypeError: 'frozenmap.frozendict.FrozenDict' object does not support item assignment
>>> del fd['a']
.........
TypeError: 'frozenmap.frozendict.FrozenDict' object does not support item deletion
>>> fd.pop('a')
.........
AttributeError: 'frozenmap.frozendict.FrozenDict' object has no attribute 'pop'

Changes:

0.5 Initial version

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

frozenmap-0.5.1.tar.gz (95.9 kB view hashes)

Uploaded Source

Built Distributions

frozenmap-0.5.1-cp36-cp36m-macosx_10_6_intel.whl (115.3 kB view hashes)

Uploaded CPython 3.6m macOS 10.6+ intel

frozenmap-0.5.1-cp35-cp35m-macosx_10_6_intel.whl (113.8 kB view hashes)

Uploaded CPython 3.5m macOS 10.6+ intel

frozenmap-0.5.1-cp34-cp34m-macosx_10_6_intel.whl (114.6 kB view hashes)

Uploaded CPython 3.4m macOS 10.6+ intel

frozenmap-0.5.1-cp27-cp27m-macosx_10_9_x86_64.whl (58.2 kB view hashes)

Uploaded CPython 2.7m macOS 10.9+ x86-64

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page