News for hackers. Stuff that matters.
Re:What’s inside Python ‘for’ loop? by theamk on Monday March 25, 2019 @09:55PM (#19488631)
The "inside" part is slightly wrong, the payload is outside of the try/except clause:

    while True:
        try:
            number = next(iter_object)
        except StopIteration:
            break
        sum += number
You can check this by throwing StopIteration inside the loop, and watching it propagate outside normally.

There are no comments on this comment yet.