[Python-ideas] Asynchronous exception handling around with/try statement borders

Greg Ewing greg.ewing at canterbury.ac.nz
Wed Jun 28 19:33:13 EDT 2017


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


More information about the Python-ideas mailing list