MCPcopy Create free account
hub / github.com/Nativu5/Gemini-FastAPI / Singleton

Class Singleton

app/utils/singleton.py:4–10  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2
3
4class Singleton(type):
5 _instances: ClassVar[dict[type, object]] = {}
6
7 def __call__(cls, *args, **kwargs):
8 if cls not in cls._instances:
9 cls._instances[cls] = super().__call__(*args, **kwargs)
10 return cls._instances[cls]

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected