From 7489a2577db03864d93b07e3e8263f2c27bb01ad Mon Sep 17 00:00:00 2001 From: Jonas Rembser Date: Tue, 12 May 2026 14:17:49 +0200 Subject: [PATCH] [Python] Prevent possible double pythonization of template classes If the current C++ global namespace containts both template instantiations and the original class template, which can happen depending on the usage pattern, it can happen that the same template instance is pythonized twice. This is prevented with additional conditionals in the pythonization code paths. --- .../pythonizations/python/ROOT/_pythonization/__init__.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/bindings/pyroot/pythonizations/python/ROOT/_pythonization/__init__.py b/bindings/pyroot/pythonizations/python/ROOT/_pythonization/__init__.py index 8907388ecd296..b2ec9c4937273 100644 --- a/bindings/pyroot/pythonizations/python/ROOT/_pythonization/__init__.py +++ b/bindings/pyroot/pythonizations/python/ROOT/_pythonization/__init__.py @@ -274,8 +274,9 @@ def get_class_name(instantiation): ns_vars = vars(ns_obj) for var_name, var_value in ns_vars.items(): - if str(var_value).startswith("