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

Public Member Functions

def __init__ (self, factory, takes_self=False)
 
def __getstate__ (self)
 
def __setstate__ (self, state)
 

Data Fields

 factory
 
 takes_self
 

Detailed Description

Stores a factory callable.

If passed as the default value to `attr.ib`, the factory is used to
generate a new value.

:param callable factory: A callable that takes either none or exactly one
    mandatory positional argument depending on *takes_self*.
:param bool takes_self: Pass the partially initialized instance that is
    being initialized as a positional argument.

.. versionadded:: 17.1.0  *takes_self*

Constructor & Destructor Documentation

◆ __init__()

def __init__ (   self,
  factory,
  takes_self = False 
)
`Factory` is part of the default machinery so if we want a default
value here, we have to implement it ourselves.

Member Function Documentation

◆ __getstate__()

def __getstate__ (   self)
Play nice with pickle.

◆ __setstate__()

def __setstate__ (   self,
  state 
)
Play nice with pickle.

Field Documentation

◆ factory

factory

◆ takes_self

takes_self

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