Generating nested code with context managers

alex23 wuwei23 at gmail.com
Tue May 4 20:38:27 EDT 2010


On May 5, 6:36 am, Terry Reedy <tjre... at udel.edu> wrote:
> The relatively new with statement and associated context managers are
> designed, among other things, for this situation, where one needs to
> alter and restore a global context. So here is my updated (3.1)
> proof-of-concept version.

This is what I love about c.l.p, you wait 10 mins and someone proves
your point with working code :)

I had a more generic 'with indentation:' context manager in mind, but
I really like your approach. Cheers.



More information about the Python-list mailing list