Skip to main content

Package frozenmap provide frozendict (C based) and frozenmap (Cython based)

Project description

frozenmap is MIT Licensed python library. It implements frozendict type (in C) and FrozenDict, FrozenMap classes (in Cython).

  • frozendict is read-only and hashable dictionary (C based).
  • FrozenMap is read-only mapping object wrapped around a mutable mapping object (Cython based).
  • FrozenDict is read-only and hashable dictionary (Cython based).

This library actually is an attempt to proof the concept of fast frozendict (C/Cython based).

Main repository for frozenmap is on bitbucket.

Quick start:

First load inventory:

>>> from frozenmap import frozendict, FrozenDict

Simple example:

>>> fd = frozendict(a=1,b=2,c=3)
>>> fd
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'


>>> 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.6 **

  • Add C implementation for frozendict.
  • Add tests for frozendict type.

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.

Files for frozenmap, version 0.6
Filename, size File type Python version Upload date Hashes
Filename, size frozenmap-0.6-cp27-cp27m-macosx_10_9_x86_64.whl (82.4 kB) File type Wheel Python version cp27 Upload date Hashes View hashes
Filename, size frozenmap-0.6-cp27-cp27m-win32.whl (69.8 kB) File type Wheel Python version cp27 Upload date Hashes View hashes
Filename, size frozenmap-0.6-cp27-cp27m-win_amd64.whl (79.6 kB) File type Wheel Python version cp27 Upload date Hashes View hashes
Filename, size frozenmap-0.6-cp34-cp34m-macosx_10_6_intel.whl (154.6 kB) File type Wheel Python version cp34 Upload date Hashes View hashes
Filename, size frozenmap-0.6-cp34-cp34m-win32.whl (70.1 kB) File type Wheel Python version cp34 Upload date Hashes View hashes
Filename, size frozenmap-0.6-cp34-cp34m-win_amd64.whl (80.5 kB) File type Wheel Python version cp34 Upload date Hashes View hashes
Filename, size frozenmap-0.6-cp35-cp35m-macosx_10_6_intel.whl (153.8 kB) File type Wheel Python version cp35 Upload date Hashes View hashes
Filename, size frozenmap-0.6-cp35-cp35m-win32.whl (73.1 kB) File type Wheel Python version cp35 Upload date Hashes View hashes
Filename, size frozenmap-0.6-cp35-cp35m-win_amd64.whl (86.8 kB) File type Wheel Python version cp35 Upload date Hashes View hashes
Filename, size frozenmap-0.6-cp36-cp36m-macosx_10_9_x86_64.whl (82.1 kB) File type Wheel Python version cp36 Upload date Hashes View hashes
Filename, size frozenmap-0.6-cp36-cp36m-win32.whl (74.3 kB) File type Wheel Python version cp36 Upload date Hashes View hashes
Filename, size frozenmap-0.6-cp36-cp36m-win_amd64.whl (87.7 kB) File type Wheel Python version cp36 Upload date Hashes View hashes
Filename, size frozenmap-0.6-cp37-cp37m-macosx_10_9_x86_64.whl (81.4 kB) File type Wheel Python version cp37 Upload date Hashes View hashes
Filename, size frozenmap-0.6.tar.gz (119.1 kB) File type Source Python version None Upload date Hashes View hashes

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page