[Python-ideas] Letting context managers react to yields inside their scope
Nathaniel Smith
njs at pobox.com
Wed Apr 29 22:22:49 CEST 2015
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
-------------- next part --------------
A non-text attachment was scrubbed...
Name: with-yield-draft-pep.rst
Type: text/x-rst
Size: 11843 bytes
Desc: not available
URL: <http://mail.python.org/pipermail/python-ideas/attachments/20150429/d97d457a/attachment.bin>
More information about the Python-ideas
mailing list