What is a context manager in Python?
Correct answer
C. An object defining __enter__ and __exit__ for use with with
5 views
C. An object defining __enter__ and __exit__ for use with with
5 views
Context managers set up and tear down resources in a with block.
Asked in: Python Interview Advanced Python
https://docs.python.org/3/library/index.htmlNot sure why the answer is C? Ask here and get an explanation.