Python Forum
i want to make my own context manager - Printable Version

+- Python Forum (https://python-forum.io)
+-- Forum: General (https://python-forum.io/forum-1.html)
+--- Forum: News and Discussions (https://python-forum.io/forum-31.html)
+--- Thread: i want to make my own context manager (/thread-22363.html)



i want to make my own context manager - Skaperen - Nov-10-2019

i want to make my own context manager. maybe more than one. i'm reading docs for module contextmanager but it seems to not be very thorough. the first one i want to make is to be file-object-like object. that is, it should be usable like a file object, including as a context manager (so its creator can be used in a with statement in place of open(). this is one reason i haven been reading up on file-object methods (to see what all i need to implement.