MCPcopy Create free account
hub / github.com/DVampire/FinAgent / __call__

Method __call__

finagent/utils/singleton.py:12–16  ·  view source on GitHub ↗

Call method for the singleton metaclass.

(cls, *args, **kwargs)

Source from the content-addressed store, hash-verified

10 _instances = {}
11
12 def __call__(cls, *args, **kwargs):
13 """Call method for the singleton metaclass."""
14 if cls not in cls._instances:
15 cls._instances[cls] = super(Singleton, cls).__call__(*args, **kwargs)
16 return cls._instances[cls]
17
18
19class AbstractSingleton(abc.ABC, metaclass=Singleton):

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected