4 ms·
What the global statement means in Python – Luca Chiodini
- timonoko 5y agoTruly global variable is a baffling mystery. I studied one bigger program, where they maintained cross-module variables in most bizarre inherited structure of references. I guess that is how professionals do it. I did not understand any of it because I am not very bright or professional. Solution was to make class globals foo=1 doo=2 .. Now you can read and modify globals.foo anywhere.