From 788366833be83cf22d2bf8b1107b8213fbbf6e71 Mon Sep 17 00:00:00 2001 From: htruscott Date: Sun, 10 May 2026 15:37:15 -0400 Subject: [PATCH] read out class.__dict__ to avoid concurrent modification Signed-off-by: htruscott --- pybind11_stubgen/parser/mixins/parse.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pybind11_stubgen/parser/mixins/parse.py b/pybind11_stubgen/parser/mixins/parse.py index 66308f1..d9522fa 100644 --- a/pybind11_stubgen/parser/mixins/parse.py +++ b/pybind11_stubgen/parser/mixins/parse.py @@ -77,7 +77,8 @@ def _iter_class_members(self, class_: type): # Iterate __dict__ keys for definition order, but resolve values # through getattr() so descriptors (staticmethod, properties, etc.) # are properly unwrapped — matching inspect.getmembers() semantics. - for name in class_.__dict__: + names = list(class_.__dict__); + for name in names: seen.add(name) try: value = getattr(class_, name)