Skip to main content

Package frozentype provide some frozen python types (frozendict (C based) and frozenmap (Cython based))

Project description

frozentype is MIT Licensed python library. It implements some frozen python types: 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 frozentype is on bitbucket.

Quick start:

First load inventory:

>>> from frozentype 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: 'frozentype._frozendict.frozendict' object does not support item assignment
>>> del fd['a']
.........
TypeError: 'frozentype._frozendict.frozendict' object does not support item deletion
>>> fd.pop('a')
.........
AttributeError: 'frozentype._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: 'frozentype.frozendict.FrozenDict' object does not support item assignment
>>> del fd['a']
.........
TypeError: 'frozentype.frozendict.FrozenDict' object does not support item deletion
>>> fd.pop('a')
.........
AttributeError: 'frozentype.frozendict.FrozenDict' object has no attribute 'pop'

Changes:

** 0.6.0.1 ** (technical version to convince pypi to upload project with fixed title in README)

** 0.6 ** (migrate from project intellimath/frozenmap)

  • 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 frozentype, version 0.6.0.1
Filename, size & hash File type Python version Upload date
frozentype-0.6.0.1-cp27-cp27m-macosx_10_9_x86_64.whl (84.9 kB) View hashes Wheel cp27
frozentype-0.6.0.1-cp27-cp27m-win32.whl (69.9 kB) View hashes Wheel cp27
frozentype-0.6.0.1-cp27-cp27m-win_amd64.whl (79.8 kB) View hashes Wheel cp27
frozentype-0.6.0.1-cp34-cp34m-macosx_10_6_intel.whl (158.7 kB) View hashes Wheel cp34
frozentype-0.6.0.1-cp34-cp34m-win32.whl (70.3 kB) View hashes Wheel cp34
frozentype-0.6.0.1-cp34-cp34m-win_amd64.whl (80.7 kB) View hashes Wheel cp34
frozentype-0.6.0.1-cp35-cp35m-macosx_10_6_intel.whl (160.1 kB) View hashes Wheel cp35
frozentype-0.6.0.1-cp35-cp35m-win32.whl (73.3 kB) View hashes Wheel cp35
frozentype-0.6.0.1-cp35-cp35m-win_amd64.whl (86.9 kB) View hashes Wheel cp35
frozentype-0.6.0.1-cp36-cp36m-macosx_10_9_x86_64.whl (86.4 kB) View hashes Wheel cp36
frozentype-0.6.0.1-cp36-cp36m-win32.whl (74.4 kB) View hashes Wheel cp36
frozentype-0.6.0.1-cp36-cp36m-win_amd64.whl (87.9 kB) View hashes Wheel cp36
frozentype-0.6.0.1-cp37-cp37m-macosx_10_9_x86_64.whl (85.9 kB) View hashes Wheel cp37
frozentype-0.6.0.1-cp37-cp37m-win32.whl (74.3 kB) View hashes Wheel cp37
frozentype-0.6.0.1-cp37-cp37m-win_amd64.whl (87.7 kB) View hashes Wheel cp37
frozentype-0.6.0.1.tar.gz (123.6 kB) View hashes Source None

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 SignalFx SignalFx Supporter DigiCert DigiCert EV certificate StatusPage StatusPage Status page