Skip to content

Commit

Permalink
Iterator's __iter__ method should return itself
Browse files Browse the repository at this point in the history
  • Loading branch information
benmwebb committed Dec 13, 2024
1 parent da08697 commit 3c5c844
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions modules/kernel/pyext/src/_list_util.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@ def __init__(self, varlist, getfunc):
self.__getfunc = getfunc
self.__n = -1

def __iter__(self):
return self

def __next__(self):
self.__n += 1
if self.__n >= self.__count:
Expand Down

0 comments on commit 3c5c844

Please sign in to comment.