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

A.M. Kuchling amk at amk.ca
Tue Apr 18 22:01:31 CEST 2006


On Tue, Apr 18, 2006 at 03:37:37PM -0400, Phillip J. Eby wrote:
> I was going to say, "so they can be context managers", but I suppose you 
> have a point.  There is no need for a context to have a __context__ method, 
> unless it is also a context manager.  Ugh.

It would be easy to just remove the parenthetical comment from the PEP
and forget about it, if in fact the statement is now purposeless.  But
these are murky waters, and maybe there's still some deeper reason for
it.  Nick, do you have any comments?

--amk



More information about the Python-Dev mailing list