cached_property(func, name=None, doc=None)[source]¶
A decorator that converts a function into a lazy property. The function wrapped is called the first time to retrieve the result and then that calculated result is used the next time you access the value:
class Foo(object): @cached_property def foo(self): # calculate something important here return 42
The class has to have a __dict__ in order for this property to work.
||Descriptor to change the deleter on a property.|
||Descriptor to change the getter on a property.|
||Descriptor to change the setter on a property.|