[Python-Dev] Must objects with enter/exit also supply context? (original) (raw)

Edward Loper edloper at gradient.cis.upenn.edu
Fri Apr 28 02:16:18 CEST 2006


Nick Coghlan wrote:

OTOH, if the two protocols are made orthogonal, then it's clear that the manager is always the original object with the context method. Then the three cases are:

- a pure context manager (only provides context) - a pure managed context (only provides enter/exit) - a managed context which can be its own context manager (provides all three)

+1 on keeping the two protocols orthogonal and using this terminology (context manager/managed context).

-Edward



More information about the Python-Dev mailing list