Jun-27-2019, 03:57 PM
Both approach can be useful. I use the second for static variable (ie. project id):
__id__.py
This is kind of a large project, but still you may have a look to see how it can be implemented:
https://gitlab.com/william.belanger/obsu...er/obsuite
__id__.py
ID = "obsuite" HELP = ["..."]__init__.py
try: from .__id__ import ID, HELP except ImportError: from __id__ import ID, HELPAnd the first approach for common variable across modules/plugins. Like Denni suggested, instead of passing variable I pass self as the module parent. The objects are accessed as pointers, so any change you make is passed upstream.
This is kind of a large project, but still you may have a look to see how it can be implemented:
https://gitlab.com/william.belanger/obsu...er/obsuite