### Things to check first - [x] I have searched the existing issues and didn't find my feature already requested there ### Feature description This would add an async counterpart for the [itertools](https://docs.python.org/3/library/itertools.html) standard library module. ### Use case The need to iterate over async iterables is a fairly common one, and this is why [aioitertools](https://github.com/omnilib/aioitertools) exists.
Activity
[-]Add asynchronous itertools implementation[/-][+]Add an asynchronous itertools implementation[/+]Added async itertools helpers and tests
11kkw commentedon Apr 6, 2026
I've been experimenting with an async counterpart to several itertools functions.
Before opening a PR, I'd like to check if the implementation direction makes
sense for AnyIO. If not, I'm happy to revise the implementation.
Any feedback would be appreciated.
agronholm commentedon Apr 6, 2026
OK, which repo should I be looking at?
11kkw commentedon Apr 6, 2026
You can take a look here:
https://github.com/11kkw/anyio/tree/feature/async-itertools-998
agronholm commentedon Apr 6, 2026
It will take a while to get through this, but a couple things caught my eye:
AsyncGeneratorfor the return type annotation so we can useasync with aclosing(...)with itagronholm commentedon Apr 6, 2026
Overall I think this looks good. There will probably be a few more change requests, but I see no problem with sending a PR.
11kkw commentedon Apr 6, 2026
You're right, that was a mistake. I'll fix it and open a PR. Thanks for reviewing.
Feature/async itertools (#1107)