Skip to content

Fix interoperability with native async generators #14

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 6 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions async_generator/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,27 @@
yield_from_,
isasyncgen,
isasyncgenfunction,
get_asyncgen_hooks,
set_asyncgen_hooks,
supports_native_asyncgens,
)
from ._util import aclosing, asynccontextmanager
from functools import partial as _partial

async_generator_native = _partial(async_generator, allow_native=True)
async_generator_legacy = _partial(async_generator, allow_native=False)

__all__ = [
"async_generator",
"async_generator_native",
"async_generator_legacy",
"yield_",
"yield_from_",
"aclosing",
"isasyncgen",
"isasyncgenfunction",
"asynccontextmanager",
"get_asyncgen_hooks",
"set_asyncgen_hooks",
"supports_native_asyncgens",
]
Loading