On Wed, 8 Aug 2018 at 16:58, Oscar Benjamin <oscar.j.benja...@gmail.com> wrote:
> Thinking about this some more: closing() can ensure finalisation but
> it is still generally bad to yield from a with block. Some context
> managers are designed to temporarily alter global state between
> __enter__ and __exit__ - this can be very confusing if you use them
> around a yield block.

Surely that's *precisely* what PEP 567 (Context Variables) was
designed to address?

Paul
_______________________________________________
Python-ideas mailing list
Python-ideas@python.org
https://mail.python.org/mailman/listinfo/python-ideas
Code of Conduct: http://python.org/psf/codeofconduct/

Reply via email to