29 Feb
2012
29 Feb
'12
11:08 p.m.
On 29 February 2012 21:47, Craig Yoshioka <craigyk@me.com> wrote:
I also think that when people use non-builtin contextmanagers it's usually within a very specific... context (*dammit*), and so they are likely to look up why they are using an object as a context manager. That's where you would document the behavior:
with uncached(path): # code here only executes if the path does not exist
Personally, I would *always* assume that the body of the with statement executes. That's what the with statement does, and I would be very surprised to see something different happen. Even with the comment, I'd be surprised. Paul.