-
Notifications
You must be signed in to change notification settings - Fork 3
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
Add support for lazy async generators #7
Conversation
gen_3 = async_yielding_iterator() | ||
|
||
self.assertEqual(counter.value, 0) | ||
self.assertEqual(await anext(gen_1), 1) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It looks like anext
was introduced in python 3.10.
Maybe we add a manaul backport?
if sys.version_info.minor < 10:
async def anext(iter): ...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done!
It looks like mypy and black are unhappy |
FYI I updated the implementation to not block other generators while awaiting the next value, please give it a close look as it's definitely a bit more complicated! |
Fixes #5