For a DB class with the following init method:
class DB: def __init__(self, dbprops): self.dbprops = dbprops self.conn =
The context manager protocol is handled by the __enter__() and __exit__() methods; the former must return the value to assign.
__enter__()
__exit__()