'Add a callable or a property descriptor to the instance.
Properties, unlike attributes, are lazily evaluated by executing
an underlying callable when accessed. They can be useful for
adding features to an object without any cost if those features
go unused.
A property may also be reified via the
:class:`pyramid.decorator.reify` decorator by setting
``reify=True``, allowing the result of the evaluation to be
cached. Using this method, the value of the property is only
computed once for the lifetime of the object.
``callable`` can either be a callable that accepts the instance
as its single positional parameter, or it can be a property
descriptor.
If the ``callable`` is a property descriptor, the ``name``
parameter must be supplied or a ``ValueError`` will be raised.
Also note that a property descriptor cannot be reified, so
``reify`` must be ``False``.
If ``name`` is None, the name of the property will be computed
from the name of the ``callable``.
.. code-block:: python
:linenos:
class Foo(InstancePropertyMixin):
_x = 1
def _get_x(self):
return _x
def _set_x(self, value):
self._x = value
foo = Foo()
foo.set_property(property(_get_x, _set_x), name=\'x\')
foo.set_property(_get_x, name=\'y\', reify=True)
>>> foo.x
1
>>> foo.y
1
>>> foo.x = 5
>>> foo.x
5
>>> foo.y # notice y keeps the original value
1'

def set_property(self, callable, name=None, reify=False):

    InstancePropertyHelper.set_property(self, callable, name=name, reify=reify)
