Skip to content

PEP 828: add synchonous delegation recipe#5013

Open
graingert wants to merge 1 commit into
python:mainfrom
graingert:add-sync-delegation-recipe-to-pep-828
Open

PEP 828: add synchonous delegation recipe#5013
graingert wants to merge 1 commit into
python:mainfrom
graingert:add-sync-delegation-recipe-to-pep-828

Conversation

@graingert

@graingert graingert commented Jul 1, 2026

Copy link
Copy Markdown
Contributor

It's technically incorrect to yield multiple times from inside a structured concurrency context: it's only correct to yield once in that context inside an async generator function decorated with @asynccontextmanager (See PEP 789), therefore the issues as stated with synchronous delegation are incorrect so I removed that text.

Instead keep the note about the complexity and include a recipe on how users can achieve this themselves without adding extra complexity to the PEP 828 implementation, with the hope this recipe can be added to the python docs in the implementation PR

@graingert graingert requested a review from ZeroIntensity as a code owner July 1, 2026 07:10
Comment thread peps/pep-0828.rst Outdated
@read-the-docs-community

read-the-docs-community Bot commented Jul 1, 2026

Copy link
Copy Markdown

Documentation build overview

📚 pep-previews | 🛠️ Build #33387846 | 📁 Comparing 7ee6edb against latest (499ac31)

  🔍 Preview build  

2 files changed
± pep-0764/index.html
± pep-0828/index.html

Comment thread peps/pep-0828.rst Outdated
Comment thread peps/pep-0828.rst Outdated
Comment thread peps/pep-0828.rst Outdated
@graingert graingert force-pushed the add-sync-delegation-recipe-to-pep-828 branch from 53734ed to 7ee6edb Compare July 1, 2026 07:20
@hugovk hugovk changed the title PEP-828: add synchonous delegation recipe PEP 828: add synchonous delegation recipe Jul 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant