A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://mail.python.org/pipermail/python-dev/2006-May/064680.html below:

[Python-Dev] More on contextlib - adding back a contextmanager decorator

[Python-Dev] More on contextlib - adding back a contextmanager decorator [Python-Dev] More on contextlib - adding back a contextmanager decoratorNick Coghlan ncoghlan at gmail.com
Mon May 1 13:42:13 CEST 2006
Greg Ewing wrote:
> Also a thought on terminology. Even though it seems I
> may have been the person who thought it up originally,
> I'm not sure I like the term "manager". It seems rather
> wooly, and it's not clear whether a "context manager"
> is supposed to manage just one context or multiple
> contexts.

I think getting rid of __context__ should clear up most of this confusion 
(which is further evidence that Guido is making the right call). Once that 
change is made, the context expression in the with statement produces a 
context manager with __enter__ and __exit__ methods which set up and tear down 
a managed context for the body of the with statement. This is very similar to 
your later suggestion of context guard and guarded context.

I believe this is actually going back to using the terminology as you 
originally suggested it (one concrete object, one abstract concept). We really 
only got into trouble once we tried to add a second kind of concrete object 
into the mix (objects with only a __context__ method).

Cheers,
Nick.

-- 
Nick Coghlan   |   ncoghlan at gmail.com   |   Brisbane, Australia
---------------------------------------------------------------
             http://www.boredomandlaziness.org
More information about the Python-Dev mailing list

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4