[Python-Dev] Terminology for PEP 343

Greg Ewing greg.ewing at canterbury.ac.nz
Tue Jul 5 09:01:00 CEST 2005


Phillip J. Eby wrote:
> At 11:48 PM 7/3/2005 -0400, Raymond Hettinger wrote:

> with context_expression as variable:
>      # perform actions within a context
> 
> The "with" statement establishes a context in which some operations are to 
> be performed.

I like this.

> The object produced by 'context_expression' must have __enter_context__ and 
> __exit_context__ methods, which will be invoked by the "with" statement 
> when the context is entered...

And we could call this the "context protocol".

Greg





More information about the Python-Dev mailing list