lsst.ctrl.pool g6ea9deef35+294f8daa5f
Public Member Functions | List of all members
lsst.ctrl.pool.pool.SingletonMeta Class Reference

Metaclass to produce a singleton. More...

Inheritance diagram for lsst.ctrl.pool.pool.SingletonMeta:
lsst.ctrl.pool.pool.Debugger lsst.ctrl.pool.pool.PoolNode lsst.ctrl.pool.pool.PoolMaster lsst.ctrl.pool.pool.PoolSlave

Public Member Functions

def __init__ (cls, name, bases, dict_)
 
def __call__ (cls, *args, **kwargs)
 

Detailed Description

Metaclass to produce a singleton.

Doing a singleton mixin without a metaclass (via __new__) is
annoying because the user has to name his __init__ something else
(otherwise it's called every time, which undoes any changes).
Using this metaclass, the class's __init__ is called exactly once.

Because this is a metaclass, note that:
* "self" here is the class
* "__init__" is making the class (it's like the body of the
  class definition).
* "__call__" is making an instance of the class (it's like
  "__new__" in the class).

Definition at line 367 of file pool.py.

Constructor & Destructor Documentation

◆ __init__()

def lsst.ctrl.pool.pool.SingletonMeta.__init__ (   cls,
  name,
  bases,
  dict_ 
)

Member Function Documentation

◆ __call__()

def lsst.ctrl.pool.pool.SingletonMeta.__call__ (   cls,
args,
**  kwargs 
)

Definition at line 387 of file pool.py.


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