Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Python] Regression in accessing protected data members in ROOT 6.32 after cppyy upgrade #16852

Open
1 task done
guitargeek opened this issue Nov 7, 2024 · 0 comments
Open
1 task done

Comments

@guitargeek
Copy link
Contributor

guitargeek commented Nov 7, 2024

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.

@guitargeek guitargeek self-assigned this Nov 7, 2024
@pcanal pcanal changed the title [Python] Regression in accessing proteced data members in ROOT 6.32 after cppyy upgrade [Python] Regression in accessing protected data members in ROOT 6.32 after cppyy upgrade Nov 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant