[Python-ideas] A couple of with statement ideas

Greg Ewing greg.ewing at canterbury.ac.nz
Fri Feb 25 21:55:50 CET 2011


From: Nick Coghlan
> It's at least a much larger set than it was back when AMK noticed the
> deep terminology confusion in the first version of the with statement
> and context management documentation (which was when Guido applied the
> Zen and dropped the __context__ method from the protocol).

I'm in favour of the idea, but the terminology problem still
needs to be solved. I think it's important that the name of the
object implementing this protocol not have the word "context" in
it *anywhere*.

I like __with__ as the special method name, as it very obviously
suggests a tight connection with the with-statement.

The only term I can think of right now for the object is
"withable object". It's a severe abuse of the English language,
I know, but unfortunately there doesn't seem to be a concise
verb meaning "enter a temporary execution context".

-- 
Greg

This email may be confidential and subject to legal privilege, it may
not reflect the views of the University of Canterbury, and it is not
guaranteed to be virus free. If you are not an intended recipient,
please notify the sender immediately and erase all copies of the message
and any attachments.

Please refer to http://www.canterbury.ac.nz/emaildisclaimer for more
information.



More information about the Python-ideas mailing list