Hello:
Imagine a system (Python) where the different parts constantly interact with one instance of a given object. What is the best way to provide a global access point to this instance?
So far I can only think of building the (Singleton) instance in __init__.py
and import
the module as needed:
# __init__.py
class Thing(object, Singleton):
pass
TheThing = Thing()
__all__ = ['TheThing']
Is there a better way to provide a global access point to TheThing
?
Thanks,
J.