-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Open
Labels
bugin:Python Interfacepriority:lowregressionThis issue was not present in a previous releases of ROOTThis issue was not present in a previous releases of ROOT
Description
Check duplicate issues.
- Checked for duplicates
Description
Getting access to protected data members when inheriting from a C++ stopped working (for protected functions it still works).
Reproducer
import cppyy
cppyy.cppdef("""
class MyBaseClass {
public:
virtual ~MyBaseClass() = default;
protected:
int protectedFunc() { return 5; }
int _protectedData = 4;
};
""")
class MyDerivedClass(cppyy.gbl.MyBaseClass):
pass
my_obj = MyDerivedClass()
print(my_obj.protectedFunc()) # works!
print(my_obj._protectedData) # doesn't work with ROOT 6.32!The reproducer fails on lxplus9 with ROOT 6.32.06 and Python 3.9.18
5
Traceback (most recent call last):
File "/afs/cern.ch/user/r/rembserj/repro.py", line 21, in <module>
print(my_obj._protectedData) # doesn't work!
AttributeError: 'MyDerivedClass' object has no attribute '_protectedData'
However, on lxplus8 with ROOT 6.30/08 and Python 3.6.8, it works.
ROOT version
ROOT >=6.32.00
Installation method
Any
Operating system
Any
Additional context
The priority of this issue is set to low, since I'm not aware of any people making use of that feature. The 6.32 release cycle came and went without any complaints at least.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bugin:Python Interfacepriority:lowregressionThis issue was not present in a previous releases of ROOTThis issue was not present in a previous releases of ROOT