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

Python

7623 readers
3 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
 

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 4 months ago

oh wow thanks!