finesse.datastore.init_singleton

finesse.datastore.init_singleton(cls, *args, **kwargs)[source]

Instantiate cls and return the object for the current and future calls.

Parameters

cls : type

The singeton class to retrieve. If cls has already been instantiated, the existing instance is returned and args and kwargs are ignored.

Returns

object

The instantiated singleton.

Other Parameters

args, kwargs

Positional and keyword arguments to pass to the cls call, if cls is not yet instantiated.