clique.descriptor

class clique.descriptor.Unsettable(label)[source]

Bases: object

Prevent standard setting of property.

Example:

>>> class Foo(object):
...
...     x = Unsettable('x')
...
...     def __init__(self):
...         self.__dict__['x'] = True
...
>>> foo = Foo()
>>> print(foo.x)
True
>>> foo.x = False
AttributeError: Cannot set attribute defined as unsettable.
__init__(label)[source]

Initialise descriptor with property label.

label should match the name of the property being described:

x = Unsettable('x')