OpenQuizz
Une application de gestion des contenus pédagogiques
|
Public Member Functions | |
def | __init__ (self, func, name=None, doc=None) |
def | __set__ (self, obj, value) |
def | __get__ (self, obj, type=None) |
Data Fields | |
func | |
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.
def __init__ | ( | self, | |
func, | |||
name = None , |
|||
doc = None |
|||
) |
def __get__ | ( | self, | |
obj, | |||
type = None |
|||
) |
def __set__ | ( | self, | |
obj, | |||
value | |||
) |
func |