When using a with
statement without a as
, does the __enter__
function never get executed but the __exit__
method will?
Example:
with test:
test.do_something
test.__exit__()
will be executed at the end of the with clause but test.__enter__()
won't?