16 Sep
2021
16 Sep
'21
5:56 p.m.
On Wed, Sep 15, 2021 at 4:06 PM Guido van Rossum <guido@python.org> wrote:
[SNIP] Reminder about how for-loops work:
This:
for x in seq: <body>
translates (roughly) to this:
_it = iter(seq) while True: try: x = next(_it) except StopIteration: break <body>
And if anyone wants more details on this, I have a blog post about it at https://snarky.ca/unravelling-for-statements/ .