Skip to content
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

Fix risky uses of __anext__() #17

Merged

Conversation

mikenerone
Copy link
Contributor

Calling __anext__() on an async iterable is dangerous, because not all iterables act as their own iterators, so may not have that method. These changes ensure that those calls explicitly get an iterator first (by calling __aiter__()).
Note: __aiter__() is called implicitly in async for constructs, so they don't have this risk.

@mikenerone mikenerone force-pushed the mikenerone/fix-ensure-use-of-iterators branch from 408988f to 428e033 Compare January 19, 2024 10:45
@andersea andersea merged commit a47bafe into andersea:master Jan 19, 2024
6 checks passed
@andersea
Copy link
Owner

Marvellous! A joy to review and merge!

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.

2 participants