issue with singleton python call two times __init__
I have a singleton like this class Singleton: class __impl: def __init__(self): print "INIT" __instance = None def __init__(self): # Check whether we already have an instance if Singleton.__instance is None: Singleton.__instance = Singleton.__impl() # Store instance reference as the only member in the handle self.__dict__['_Singleton__instance'] = Singleton.__instance def __getattr__(self, attr): """ Delegate access to implementation """ return getattr(self.__instance, attr) def __setattr__(self, attr, value): """ Delegate access to implementation """ return setattr(self.__instance, attr,