# Preventing \`yield\` inside certain context managers

**URL:** <https://discuss.python.org/t/preventing-yield-inside-certain-context-managers/1091>\
**Category:** Ideas\
**Created:** [April 2, 2019, 7:32am UTC](https://discuss.python.org/t/preventing-yield-inside-certain-context-managers/1091 "2019-04-02T07:32:12Z")\
**Posts on this page:** 1\
**Showing post:** 23

<div class="post-metadata">

**Author:** ![encukou](https://sea2.discourse-cdn.com/flex002/user_avatar/discuss.python.org/encukou/32/2461_2.png) [@encukou](https://discuss.python.org/u/encukou)\
**Post date:** [February 23, 2022, 9:58am UTC](https://discuss.python.org/t/preventing-yield-inside-certain-context-managers/1091/23 "2022-02-23T09:58:09Z")

</div>

AFAICS, this almost is a PEP already – use boring PEP terminology (“What’s this?” → “Abstract” and so on), use boring asyncio terminology (“task groups” rather than “nurseries”), assign a number, and it’s a PEP :‍)

I wouldn’t really mind it going in without a PEP, but there are some reasons for PEPifying:

- The rationale is worth preserving even after/if we move off Discourse, and it’s too detailed for the documentation. A PEP is a good place to put it.
- Request comments in the usual place people are looking for Python RFCs.

I haven’t seen any opposition (but that’s to be expected for a [power plant part](https://bikeshed.com/) proposal). If asyncio experts are OK with it, I don’t see it getting blocked.

---

_[View the full topic](https://discuss.python.org/t/preventing-yield-inside-certain-context-managers/1091)._
