[Python-Dev] 'With' context documentation draft (was Re: Terminology for PEP 343

Delaney, Timothy (Tim) tdelaney at avaya.com
Thu Jul 7 01:32:05 CEST 2005


Well, I'm convinced. My votes go to "context management protocol" and
@contextmanager. Simple, descriptive and specific in meaning yet wide
enough to cover pretty much all the cases we care about.

I think we should state in the docs that the most common usage is to set
up a specific context and restore the context to what it was before the
with statement at the end of the with statement. Any other use should
contain dire warnings ;) This works for the HTML tags - the original
context is being outside the <html> tag - and the additional explanation
is sufficient warning IMO.

Tim Delaney


More information about the Python-Dev mailing list