
June 28, 2017
4:33 p.m.
Erik Bray wrote:
My question would be to make that a language-level requirement of the context manager protocol, or just something CPython does...
I think it should be a language-level requirement, otherwise it's not much use. Note that it's different from some existing CPython-only behaviour such as refcounting, because it's possible to code around those things on other implementations that don't provide the same guarantees, but here there's *no* way to code around it. At the very least, it should be a documented guarantee in CPython, not just something left "up to the implementation". -- Greg