[Python-ideas] revisit pep 377: good use case?

Paul Moore p.f.moore at gmail.com
Thu Mar 1 00:08:40 CET 2012

On 29 February 2012 21:47, Craig Yoshioka <craigyk at 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.


More information about the Python-ideas mailing list