I'm very new in Py but I know the syntax function(param1,.. paramN) and I can't understand this:
globals()['z'] = 8
Could not be more 'standar' ?
globals('z') = 8
# or..
globals(param = 'z') = 8
EDIT: thanks to all for yours answers, I just have a couple of hours playing with Python
In retrospective it's "obvious" globals() returns a instance and I acceding to the index when I write globals('z') but the Dict is returned BY REFERENCE because I can change it just doing:
globals()['z'] = 8
or... just another member suggest:
x = globals();
x['z'] = 8
All the "magic" was just a pointer to the index :)