Skip to main content

Function to convert data into freezed (immutable) version

Project description

Short description

Function converts recursively an object of standard (im-)mutable types into strictly immutable ones.

Long description

In Python sometimes it is useful to have a “static” struct to be shared across functions and classes and to guarantee it can not be changed accidentally by some code.

In addition to standard immutable simple types (like int, str etc.), there are two complex types: frozenset and tuple. Unfortunately years ago (2012-02) there was PEP-0416[1] where a frozendict was rejected as hard to be implemented.

Unlike other wrappers implementation here works similar to a copy.deepcopy function which immediately copies mutable objects into immutable analogues instead of wrapping them at access time. Therefore if a code passes already immutable object, there is almost no overhead, but the code do not need to pay attention whether to deepcopy of incoming (or outgoing) data or not.

[1] https://www.python.org/dev/peps/pep-0416/

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

objfreeze-0.1.0b0.tar.gz (3.8 kB view details)

Uploaded Source

Built Distributions

objfreeze-0.1.0b0-py3.6.egg (6.3 kB view details)

Uploaded Source

objfreeze-0.1.0b0-py3-none-any.whl (4.9 kB view details)

Uploaded Python 3

File details

Details for the file objfreeze-0.1.0b0.tar.gz.

File metadata

  • Download URL: objfreeze-0.1.0b0.tar.gz
  • Upload date:
  • Size: 3.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.12.1 pkginfo/1.4.2 requests/2.20.1 setuptools/40.6.2 requests-toolbelt/0.8.0 tqdm/4.28.1 CPython/3.6.6

File hashes

Hashes for objfreeze-0.1.0b0.tar.gz
Algorithm Hash digest
SHA256 ec2640d7fe188bc4f8ab7757472a04a6b483a415902a950389c2766eab15e124
MD5 ef6551e378cef9fef69aea6536c57a80
BLAKE2b-256 6475bd8112e03b73174cb5f4b842c2bc57c07557a8fc55bc2badae1921e79169

See more details on using hashes here.

File details

Details for the file objfreeze-0.1.0b0-py3.6.egg.

File metadata

  • Download URL: objfreeze-0.1.0b0-py3.6.egg
  • Upload date:
  • Size: 6.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.12.1 pkginfo/1.4.2 requests/2.20.1 setuptools/40.6.2 requests-toolbelt/0.8.0 tqdm/4.28.1 CPython/3.6.6

File hashes

Hashes for objfreeze-0.1.0b0-py3.6.egg
Algorithm Hash digest
SHA256 2a3af08c5d8cf1f7d6813bb056d3e9da4242e38e8a1f9baf2b68dd6ce86a86a7
MD5 8b851ab8619f71b24ea83f0de6546191
BLAKE2b-256 7fa4d481a52fb7dd28fe9865bb8aebc301c5b11c02d59a5236a7d3e533b0462e

See more details on using hashes here.

File details

Details for the file objfreeze-0.1.0b0-py3-none-any.whl.

File metadata

  • Download URL: objfreeze-0.1.0b0-py3-none-any.whl
  • Upload date:
  • Size: 4.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.12.1 pkginfo/1.4.2 requests/2.20.1 setuptools/40.6.2 requests-toolbelt/0.8.0 tqdm/4.28.1 CPython/3.6.6

File hashes

Hashes for objfreeze-0.1.0b0-py3-none-any.whl
Algorithm Hash digest
SHA256 07849711f76613c381fe76838c4b74e6a55b398a20ab475fee51c9e430f7b78e
MD5 e03782f07329b964ecb780a7961f9355
BLAKE2b-256 e570d09502964f365aa9c6c2984a3558ad7a8fa4216299938fb37337587142b3

See more details on using hashes here.

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