The advantage of your ExitMap over helper (besides being shorter, and conceptually simpler) is that it’s never misleading.
[snip]
Thank you for this, particular your example (snipped). I agree. But maybe I'm biased.
It still seems like overkill for the case of “how do I get parens somewhere around a bunch of open calls so I can write a multiline with statement”, and I’m not sure how often it would be useful in other cases.
It depends, I think, on how often it's used.
But it seems like it’s at least worth building for your personal toolbox and keeping track of how often it comes up (and how much nicer it makes things), and maybe publishing it to PyPI or submitting it to contextlib2 so more people will do the same.
A personal toolbox is, well, a personal matter. I'm all in favour of sharing. But I'd rather someone else, more motivated, would take on putting it up onto PyPI.
I hope we're mostly all agreed, anyway, that we've given a satisfactory answer to the Original Poster's query.
--
Jonathan