[Python-Dev] Why are contexts also managers? (was r45544 - peps/trunk/pep-0343.txt)
Nick Coghlan
ncoghlan at gmail.com
Fri Apr 21 14:59:10 CEST 2006
Greg Ewing wrote:
> Nick Coghlan wrote:
>
>> During implementation, the meanings of "context" and "context manager" were
>> swapped from the meanings in the approved PEP, leading to the current
>> situation where decimal.Context is actually not, in fact, a context.
>
> That's rather disappointing. I *liked* the way that
> decimal.Context was a context. Was there a conscious
> choice to swap the terms, or did it happen by accident?
That's what I'm currently trying to find out - whether or not this was a
deliberate decision made at PyCon. Conference sprints are great for getting
things done, but they do occasionally lead to decisions getting made without
being properly recorded :)
The terminology in the current docs is more natural in some ways than what the
PEP settled on (mainly due to the __context__ method), so I'm wondering if the
downside that lead us to pick the slightly more awkward terminology may have
been forgotten at the time of implementation.
Unfortunately this kind of discussion can take days via email*, even though it
would probably only take ten minutes or so in person - not getting any
immediate feedback when your point of view isn't being understood really slows
things down.
I'm just glad AMK noticed the discrepancy - I completely missed it when I read
the contextlib docs (I suspect my brain was being 'helpful' and automatically
filled in what I expected to see rather than what was actually there).
Cheers,
Nick.
* s/can take/already has taken/ ;)
--
Nick Coghlan | ncoghlan at gmail.com | Brisbane, Australia
---------------------------------------------------------------
http://www.boredomandlaziness.org
More information about the Python-Dev
mailing list