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

Devin Jeanpierre jeanpierreda at gmail.com
Thu Mar 1 02:56:45 CET 2012


On Wed, Feb 29, 2012 at 6:08 PM, Paul Moore <p.f.moore at gmail.com> wrote:
> 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.

with open('/path/that/doesnt/exist.txt', 'r') as f:
    # code that doesn't get executed
    pass

-- Devin



More information about the Python-ideas mailing list