class Foo : x = 1f1 = Foo()f2 = Foo()print f1.xprint f2.xf1.__class__.__dict__['x'] = 2print f1.xprint f2.xf3 = Foo()print f3.xf3.x = 3print f2.xprint f3.xif f2.x == f2.__class__.__dict__['x'] : print "No change"if f3.x == f3.__class__.__dict__['x'] : print "No change"else : print "Value changed"
Name (required)
email (will not be published) (required)
Website