1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
class Idiot(object): def marazm(self): x = [1] def make_me_stupid(): x[0]+=1 print x[0] make_me_stupid() print x[0] idiot = Idiot() idiot.marazm() 1 2