__enter__ and __exit__ for 'with ~ as ~ ' statement