Details
-
Bug
-
Status: Closed (View Workflow)
-
High
-
Resolution: Fixed
-
master, 6.22/02
-
None
-
Centos7, Python2/3
Description
In order to inherit from TSelector, old PyROOT provided the TPySelector class so that calls from C++ would be redirected to Python for those methods overridden in Python.
This should not be necessary in the new PyROOT, since cppyy implements the automatic generation of a C++ wrapper class during inheritance Python/C++ . Such class inherits from the C++ base class and redirects any call to Python for overridden methods in Python. Therefore, making the Python class inherit directly from TSelector should be sufficient.
However, when making a Python class inherit directly from TSelector, an error occurs. For example, the following code:
import ROOT |
|
class MyPySelector(ROOT.TSelector): |
pass |
throws
Traceback (most recent call last):
|
File "simplets.py", line 3, in <module>
|
class MyPySelector(ROOT.TSelector):
|
KeyError: 'fOutput'
|
fOutput is a protected data member of TSelector, which makes the C++ wrapper class generated during inheritance include using TSelector::fOutput;. Therefore, this issue is related to ROOT-10872, i.e. the problem with the using declarations.