Is this form of global variable declaration good practice in Python? My dictionary has no data in B.py in some cases. Just seems inconsistent.
classes.py
class Aclass:
dict = {}
myClass = Aclass()
A.py:
from classes import myClass
myClass.dict["variable"]
B.py:
from classes import myClass
print str(myClass.dict)
A.py is processed before B.py. This prints an empty dict {} for me.
This is a simplified question from previous post: Shared/Global Dictionary in Django Between URLs and Context Processor. Your insight is appreciated.
myClass.dict["variable"] = "value"(or something to that effect)?