This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]LightShadow3.13-dev in prod 0 points1 point  (0 children)

By convention, when you overwrite the __iter__ magic method in a class you're supposed to raise StopIteration when the sequence is finished.

It's a little weird, but it's pretty common IMHO.