Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/garrison/python-immutable

Immutable objects in python
https://github.com/garrison/python-immutable

Last synced: about 2 months ago
JSON representation

Immutable objects in python

Awesome Lists containing this project

README

        

python-immutable
================

Immutable objects in python.

Rationale
---------

(coming soon)

Usage
-----

::

from immutable import immutable_object

class MyClass(immutable_object):
def __init__(self, x):
self.x = x

mc = MyClass(3)
print(mc.x)

mc.x = 2 # raises TypeError
del mc.x # raises TypeError
mc.y = 3 # raises TypeError