Context manager as a decorator with access to the yielded object
Context manager as a decorator with access to the yielded object Question: I have a context manager for an object that can be used similar to the open context manager, e.g. with MyContextManager as cm: cm.do_something() I know that a simple context manager can be made into a decorator if using contextlib.ContextDecorator to create it. …