engforge.patterns.SingletonMeta

class SingletonMeta[source]

Bases: type

Metaclass for singletons. Any instantiation of a Singleton class yields the exact same object, e.g.:

>>> class MyClass(metaclass=Singleton):
        pass
>>> a = MyClass()
>>> b = MyClass()
>>> a is b
True

Methods

mro

Return a type's method resolution order.

__call__(*args, **kwargs)[source]

Call self as a function.

mro()

Return a type’s method resolution order.