use Lib class P def main trace Foo f = Foo() trace f.bar f.bar = 3 assert f.bar == 3 print 'done.'