One technique i use is a local variable in a module as the class, with a factory function to create or provide the reference to the instance



instance = None

def GetSingleInstance():
if...