I have 2 function that use the same variable, like this:
some_function():
#do something with MyDict
MyDict = dict()
MyDict['name'] = 'hallo'
main():
#do something else with MyDict
MyDict['age'] = 33
some_function()
I don't want to use global
and let say that MyDict
is very big and I don't want to pass it to some_function
. what is the best way to do so? there is a way to pass a pointer to MyDict
?
PS: I'm using py3.2