[Python-ideas] Letting context managers react to yields inside their scope

Guido van Rossum guido at python.org
Wed Apr 29 22:36:14 CEST 2015


This seems reasonable, though mostly also non-urgent. Have you thought
about how it interacts with PEP 492 yet?

On Wed, Apr 29, 2015 at 1:22 PM, Nathaniel Smith <njs at pobox.com> wrote:

> Hi all,
>
> Well, after a few days no-one has responded to my post on another
> thread about this [1], but the more I thought about it the more this
> seemed like a good idea, so I wrote up a little more-formal proposal
> (attached) for letting context managers react to 'yield's that occur
> within their 'with' block.
>
> This should in many ways be treated as a straw man proposal -- there's
> tons I don't know about how async code is written in Python these days
> -- but it seems like a good idea to me and I'd like to hear what
> everyone else thinks :-).
>
> -n
>
> [1] https://mail.python.org/pipermail/python-ideas/2015-April/033176.html
>
> --
> Nathaniel J. Smith -- http://vorpus.org
>
> _______________________________________________
> Python-ideas mailing list
> Python-ideas at python.org
> https://mail.python.org/mailman/listinfo/python-ideas
> Code of Conduct: http://python.org/psf/codeofconduct/
>



-- 
--Guido van Rossum (python.org/~guido)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-ideas/attachments/20150429/bd964465/attachment-0001.html>


More information about the Python-ideas mailing list