From 788366833be83cf22d2bf8b1107b8213fbbf6e71 Mon Sep 17 00:00:00 2001 From: htruscott Date: Sun, 10 May 2026 15:37:15 -0400 Subject: [PATCH 1/2] 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) From b450f227b236a675b921cd2536fbadd94b086f36 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Wed, 3 Jun 2026 05:56:39 +0000 Subject: [PATCH 2/2] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- pybind11_stubgen/parser/mixins/parse.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pybind11_stubgen/parser/mixins/parse.py b/pybind11_stubgen/parser/mixins/parse.py index d9522fa..c02e2fc 100644 --- a/pybind11_stubgen/parser/mixins/parse.py +++ b/pybind11_stubgen/parser/mixins/parse.py @@ -77,7 +77,7 @@ 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. - names = list(class_.__dict__); + names = list(class_.__dict__) for name in names: seen.add(name) try: