Skip to content

Make merge return optional asynccontextmanager and make examples use it - #304

Open
msullivan wants to merge 2 commits into
mainfrom
with-merge
Open

msullivan wants to merge 2 commits into
mainfrom
with-merge

Conversation

@msullivan

Copy link
Copy Markdown
Collaborator

All of our examples that use merge currently don't aclose it, which
is kind of fragile. None of the examples break out of the loop, and
they shouldn't raise any exceptions, but custom loops that did break
would cause problems.

To avoid compat problems, make it optionally a context manager (like
open, etc): when used as a contextmanager, it acloses.

Make all the examples use it with async with.

It is kind of uglier, though! What do people think?

…e it

All of our examples that use merge currently don't `aclose` it, which
is kind of fragile. None of the examples break out of the loop, and
they shouldn't raise any exceptions, but custom loops that did break
would cause problems.

To avoid compat problems, make it *optionally* a context manager (like
`open`, etc): when used as a contextmanager, it acloses.

Make all the examples use it with `async with`.

It is kind of uglier, though! What do people think?
@msullivan msullivan added the feature New functionality label Sep 22, 2026
@msullivan
msullivan requested review from 1st1 and anbuzin September 22, 2026 18:33
@vercel

vercel Bot commented Sep 22, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
ai-python Ready Ready Preview, v0 Sep 24, 2026 6:42pm UTC

This branch was successfully deployed

1 active deployment
Preview — b2c92ad9 Deployed Sep 24, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feature New functionality

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant