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-April/064217.html below:

[Python-Dev] Why are contexts also managers? (wasr45544 -peps/trunk/pep-0343.txt)

[Python-Dev] Why are contexts also managers? (wasr45544 -peps/trunk/pep-0343.txt) [Python-Dev] Why are contexts also managers? (wasr45544 -peps/trunk/pep-0343.txt)Baptiste Carvello baptiste13 at altern.org
Sun Apr 23 14:10:58 CEST 2006
Terry Reedy a écrit :
> So I propose that the context maker be called just that: 'context maker'. 
> That should pretty clearly not be the context that manages the block 
> execution.
> 
+1 for context maker. In fact, after reading the begining of the thread, I came 
  up with the very same idea.

> Similar, a context_maker function could be named any of 'context_maker', 
> 'context_manager', or 'context', with the latter two referring to the 
> return value.  In the context of 'with ____ as name:', either of the latter 
> two reads better to me.
> 
> I would call the decorator @contextmaker since that is what it turns the 
> decorated function into.
> 
I'm confused here. Do we agree that the object with __enter__ and __exit__ is a 
context manager, and the object with just __context__ is a context maker ?
If so , I would say the decorator still produces a context manager.

Baptiste

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