Repository navigation
Conversation
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Continues r-lib/coro#60 by Joe Cheng. It is in a new PR so Joe doesn't get notifications for follow-up commits. His commit is kept as-is, with him as author, on top of current
main.async_gen()creates a one-off async generator instance, the same waygen()does for normal generators. It is handy for adapting async streams withawait_each(). This PR adds tests (instance creation,await()inside, chaining streams, caller env), a NEWS bullet, and says in theexprdocs thatawait()is allowed.Two known differences from
gen()are pinned in tests:async_gen(NULL)collects tolist(NULL)because async generators yield their return value, andasync_gen()with no expression errors.