Re: contextlib.closing annoyance

2007-06-25 Thread Klaas
On Jun 22, 4:54 pm, Paul Rubin wrote: > it looks like contextlib.closing fails to be idempotent, > i.e. wrapping closing() around another closing() doesn't work. > This is annoying because the idea of closing() is to let you > use legacy file-like objects as targets of t

contextlib.closing annoyance

2007-06-22 Thread Paul Rubin
it looks like contextlib.closing fails to be idempotent, i.e. wrapping closing() around another closing() doesn't work. This is annoying because the idea of closing() is to let you use legacy file-like objects as targets of the "with" statement, e.g. with closing(gzip.open(filename)) as zf: .