fork download
  1. import gc
  2.  
  3. class Foo(object):
  4. x = 'foo'
  5.  
  6. print(Foo().x)
  7.  
  8. gc.get_referents(Foo.__dict__)[0]['x'] = 'bar'
  9.  
  10. print(Foo().x)
Success #stdin #stdout 0.04s 9320KB
stdin
Standard input is empty
stdout
foo
foo