|
lsst.ctrl.pool g6ea9deef35+68f9b4c3c9
|
Metaclass to produce a singleton. More...
Public Member Functions | |
| def | __init__ (cls, name, bases, dict_) |
| def | __call__ (cls, *args, **kwargs) |
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).
| def lsst.ctrl.pool.pool.SingletonMeta.__init__ | ( | cls, | |
| name, | |||
| bases, | |||
| dict_ | |||
| ) |
Reimplemented in lsst.ctrl.pool.pool.Debugger, lsst.ctrl.pool.pool.PoolMaster, and lsst.ctrl.pool.pool.PoolNode.
| def lsst.ctrl.pool.pool.SingletonMeta.__call__ | ( | cls, | |
| * | args, | ||
| ** | kwargs | ||
| ) |