fork download
  1.  
  2. class Foo(object):
  3. _bar = 0
  4.  
  5. @property
  6. def bar(self):
  7. return Foo._bar
  8.  
  9. @bar.setter
  10. def bar(self, value):
  11. Foo._bar = value
  12.  
  13. @bar.deleter
  14. def bar(self):
  15. pass
  16.  
  17. a = Foo()
  18. b = Foo()
  19.  
  20. print a.bar
  21. print b.bar
  22.  
  23. a.bar += 1
  24.  
  25. print a.bar
  26. print b.bar
Success #stdin #stdout 0.01s 7896KB
stdin
Standard input is empty
stdout
0
0
1
1