class C(object):
def __enter__(self):
print('jinru')
return self
def __exit__(self, exc_type, exc_val, exc_tb):
print('chuqu')
with C() as f:
print(f)
print(123)
with the statement within the next method __enter__ a double and __exit__ the first execution __enter__ doing operations and then execute __exit__ exit