engforge.patterns.InputSingletonMeta

class InputSingletonMeta[source]

Bases: type

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

>>> class MyClass(metaclass=Singleton):
        pass
>>> a = MyClass(input='same')
>>> b = MyClass(input='diff')
>>> a is b
False

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.