python - Provide Global Access Point to an Instance of an Object -


Imagine a system (Python), where different parts interact constantly with an example of a given object . What is the best way to provide universal access points for this example?

So far I only have __init __. Py and Import Module Requirement:

  # __init__.py Class Thing (Object, Singleton): The Typing = Thing () __all__ = [ 'The Typing']  

What is the TheThing ?

j is a better way to provide a universal access point for

Do not use singletons in Python Python module are great single songs ( They only get started once and are available everywhere) and if you need it, you can be one in a global variable.

The explanation given here is:


Comments

Popular posts from this blog

c# - sqlDecimal to decimal clr stored procedure Unable to cast object of type 'System.Data.SqlTypes.SqlDecimal' to type 'System.IConvertible' -

Calling GetGUIThreadInfo from Outlook VBA -

Obfuscating Python code? -