Is there a "pythonic" way to use an instance of a class for a module. For example:
class MyClass:
def __init__(self):
self.my_var = "cool value"
_instance = MyClass()
def getInstance():
return _instance()
The goal is to share large lookup classes through the application instead of initializing them on every import.
getInstancefunction? Note, it throws an error, since you return the result of calling_instance, butMyClassobjects aren't callable...