From 364ac48d5eb821122ba1184f3dea89fc5e009569 Mon Sep 17 00:00:00 2001
From: Enric Tejedor Saavedra <enric.tejedor.saavedra@cern.ch>
Date: Tue, 19 Feb 2019 15:30:16 +0100
Subject: [PATCH] [Exp PyROOT] Exploit the fact that TIter instances are
 iterable

---
 .../PyROOT/python/ROOT/pythonization/_tcollection.py         | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/bindings/pyroot_experimental/PyROOT/python/ROOT/pythonization/_tcollection.py b/bindings/pyroot_experimental/PyROOT/python/ROOT/pythonization/_tcollection.py
index 95a35a90d60..c5335f1e687 100644
--- a/bindings/pyroot_experimental/PyROOT/python/ROOT/pythonization/_tcollection.py
+++ b/bindings/pyroot_experimental/PyROOT/python/ROOT/pythonization/_tcollection.py
@@ -88,10 +88,9 @@ def _iter_pyz(self):
     # Parameters:
     # - self: collection to be iterated
     it = cppyy.gbl.TIter(self)
-    o = it.Next()
-    while o:
+    # TIter instances are iterable
+    for o in it:
         yield o
-        o = it.Next()
 
 
 @pythonization()
-- 
GitLab