Skip to content

Instantly share code, notes, and snippets.

View HaterCheaters's full-sized avatar
💭
Past, present, future: all are one in Yog-Sothoth

HaterCheaters

💭
Past, present, future: all are one in Yog-Sothoth
View GitHub Profile
class Singleton:
_isinstance = dict()
_initialized = set()
def __new__(cls, *args, **kwargs):
if cls not in cls._isinstance:
cls._isinstance[cls] = super().__new__(cls)
return cls._isinstance[cls]
@classmethod