What are you doing with with syntax
c = PokoClass()
with c as poko:
poko.hoge()
Is
c = PokoClass()
poko = c.__enter__()
poko.hoge()
c.__exit__()
Synonymous with.
__exit () __
takes four arguments: self, exc_type, exc_value, traceback. None is passed if no exception is raised
Recommended Posts