From 3c5c84458fc8508d8bf584665b71e19e9d3019f5 Mon Sep 17 00:00:00 2001 From: Ben Webb Date: Thu, 12 Dec 2024 17:02:21 -0800 Subject: [PATCH] Iterator's __iter__ method should return itself --- modules/kernel/pyext/src/_list_util.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/modules/kernel/pyext/src/_list_util.py b/modules/kernel/pyext/src/_list_util.py index 497593f259..9463f41828 100644 --- a/modules/kernel/pyext/src/_list_util.py +++ b/modules/kernel/pyext/src/_list_util.py @@ -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: