{'__hash__': <method-wrapper '__hash__' of Foo object at 0x40366a2c>, '__module__': '__main__', '__reduce_ex__': <built-in method __reduce_ex__ of Foo object at 0x40366a2c>, '__new__': <built-in method __new__ of type object at 0x4012ba80>, '__reduce__': <built-in method __reduce__ of Foo object at 0x40366a2c>, '__str__': <method-wrapper '__str__' of Foo object at 0x40366a2c>, '__getattribute__': <method-wrapper '__getattribute__' of Foo object at 0x40366a2c>, '__class__': <class '__main__.Foo'>, 'l': [1], '__delattr__': <method-wrapper '__delattr__' of Foo object at 0x40366a2c>, '__repr__': <method-wrapper '__repr__' of Foo object at 0x40366a2c>, '__setattr__': <method-wrapper '__setattr__' of Foo object at 0x40366a2c>, '__dict__': {'x': 1, 'l': [1]}, 'x': 1, 'foo': <bound method Foo.foo of <__main__.Foo object at 0x40366a2c>>, '__weakref__': None, '__doc__': None, '__init__': <bound method Foo.__init__ of <__main__.Foo object at 0x40366a2c>>}
{'__module__': '__main__', '__reduce_ex__': <built-in method __reduce_ex__ of Foo object at 0x40366a2c>, 'obj': <__main__.Foo object at 0x40366a2c>, 'd': {'__hash__': <method-wrapper '__hash__' of Foo object at 0x40366a2c>, '__module__': '__main__', '__reduce_ex__': <built-in method __reduce_ex__ of Foo object at 0x40366a2c>, '__new__': <built-in method __new__ of type object at 0x4012ba80>, '__reduce__': <built-in method __reduce__ of Foo object at 0x40366a2c>, '__str__': <method-wrapper '__str__' of Foo object at 0x40366a2c>, '__getattribute__': <method-wrapper '__getattribute__' of Foo object at 0x40366a2c>, '__class__': <class '__main__.Foo'>, 'l': [1], '__delattr__': <method-wrapper '__delattr__' of Foo object at 0x40366a2c>, '__repr__': <method-wrapper '__repr__' of Foo object at 0x40366a2c>, '__setattr__': <method-wrapper '__setattr__' of Foo object at 0x40366a2c>, '__dict__': {'x': 1, 'l': [1]}, 'x': 1, 'foo': <bound method Foo.foo of <__main__.Foo object at 0x40366a2c>>, '__weakref__': None, '__doc__': None, '__init__': <bound method Foo.__init__ of <__main__.Foo object at 0x40366a2c>>}, '__dict__': {'x': 1, 'l': [1]}, '__getattribute__': <method-wrapper '__getattribute__' of Foo object at 0x40366a2c>, '__str__': <method-wrapper '__str__' of Foo object at 0x40366a2c>, '__reduce__': <built-in method __reduce__ of Foo object at 0x40366a2c>, '__class__': <class '__main__.Foo'>, 'l': [1], '__delattr__': <method-wrapper '__delattr__' of Foo object at 0x40366a2c>, '__repr__': <method-wrapper '__repr__' of Foo object at 0x40366a2c>, '__setattr__': <method-wrapper '__setattr__' of Foo object at 0x40366a2c>, '__hash__': <method-wrapper '__hash__' of Foo object at 0x40366a2c>, 'x': '__init__', 'foo': <bound method Foo.foo of <__main__.Foo object at 0x40366a2c>>, '__weakref__': None, '__doc__': None, '__init__': <bound method Foo.__init__ of <__main__.Foo object at 0x40366a2c>>, '__new__': <built-in method __new__ of type object at 0x4012ba80>}
Traceback (most recent call last):
Line 33, in <module>
f.foo()
Line 29, in foo
l.append(2)
File "/usr/lib/python2.5/contextlib.py", line 29, in __exit__
self.gen.throw(type, value, traceback)
Line 12, in f
yield
Line 27, in foo
print x, l
UnboundLocalError: local variable 'x' referenced before assignment