[Python-ideas] ExitStack: Allow exiting individual context managers

Ram Rachum ram at rachum.com
Sun Dec 6 16:48:41 EST 2015


Hi guys,

I'm using `contextlib.ExitStack` today, and pushing context managers into
it. I find myself wanting to exit specific context managers that I've
pushed into it, while still inside the `with` suite of the `ExitStack`. In
other words, I want to exit one of the context managers but still keep the
`ExitStack`, and all other context managers, acquired. This isn't currently
possible, right? What do you think about implementing this?


Thanks,
Ram.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-ideas/attachments/20151206/d1546dbd/attachment.html>


More information about the Python-ideas mailing list