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".