Skip to content

Instantly share code, notes, and snippets.

Last active Oct 31, 2019
What would you like to do?
cloud global object
class globalizer():
def __init__(self):
global a
a = self #global self formbidden bcs self is an ARGUMENT
cloud = globalizer()
if __name__ == '__main__':
cloud.nbr = 1
cloud.string = 'Hello World'
def randFunction():
for i in range(cloud.nbr):
Copy link

JorisPLA7 commented Apr 4, 2019

Just a personnal note for global objects

Copy link

JorisPLA7 commented Oct 31, 2019

A cleaner way to set global variable, import this in your project.
Still not a good practice in a common situation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment