lsst.ctrl.pool
20.0.0
|
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:
def lsst.ctrl.pool.pool.SingletonMeta.__init__ | ( | cls, | |
name, | |||
bases, | |||
dict_ | |||
) |
def lsst.ctrl.pool.pool.SingletonMeta.__call__ | ( | cls, | |
* | args, | ||
** | kwargs | ||
) |