class Foo (object):
    
    def __enter__ (self):
        print("Enter")
        return 1
        
    def __exit__ (self, exit, value, exc):
        print("Exit")
        
with Foo() as foo:
    print(foo)
