OpenQuizz
Une application de gestion des contenus pédagogiques
cached_property Class Reference
Inheritance diagram for cached_property:
Collaboration diagram for cached_property:

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
 

Detailed Description

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.

Constructor & Destructor Documentation

◆ __init__()

def __init__ (   self,
  func,
  name = None,
  doc = None 
)

Member Function Documentation

◆ __get__()

def __get__ (   self,
  obj,
  type = None 
)

◆ __set__()

def __set__ (   self,
  obj,
  value 
)

Field Documentation

◆ func

func

The documentation for this class was generated from the following file: