14
how to use async for? (discuss.tchncs.de)

what does async for do? or, how do async iterators in general work, because I'm pretty sure async for just helps you iterate on an async iterator.

I think async iterators have a method __anext__() which "steps through the iterable"? I don't understand what stepping through means.

Also __anext__() returns an awaitable? what does that mean, especially if I have something like an AsyncIterator[Object], what does the awaitable have to do with the object?

you are viewing a single comment's thread
view the rest of the comments
[-] smq@discuss.tchncs.de 2 points 1 week ago

oh wow thanks!

this post was submitted on 15 Aug 2025
14 points (100.0% liked)

Python

7406 readers
1 users here now

Welcome to the Python community on the programming.dev Lemmy instance!

📅 Events

PastNovember 2023

October 2023

July 2023

August 2023

September 2023

🐍 Python project:
💓 Python Community:
✨ Python Ecosystem:
🌌 Fediverse
Communities
Projects
Feeds

founded 2 years ago
MODERATORS