fork download
  1. class test(object):
  2. d=0
  3. def __init__(self):
  4. type(self).d=self.d+1;
  5.  
  6. D=test()
  7. print D.d
  8. D1=test()
  9. print D1.d
  10. D2=test()
  11. print D2.d
Success #stdin #stdout 0.01s 7728KB
stdin
Standard input is empty
stdout
1
2
3