cascading_property

A property whose setter (and deleter) cascade: once the setter body has run, the dependents of the property’s name are reset. Used as a decorator, with or without arguments::

@cascading_property
def coords(self): ...
@coords.setter
def coords(self, c): ...

@cascading_property(depends_on=['embedding'])
def masses(self): ...

With always=False, assigning a value equal to the one the property already holds doesn’t cascade.

 

__init__(self, fget=None, fset=None, fdel=None, doc=None, *, depends_on=(), keyed=(), reset=None, name=None, always=True): 

 

__call__(self, fget): 

 

getter(self, fget): 

 

setter(self, fset): 

 

deleter(self, fdel): 

 

__set_name__(self, owner, name): 

 

__set__(self, obj, value): 

 

__delete__(self, obj): 

Feedback

Examples

Templates

Documentation