-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Closed
Labels
Description
Description
After removing a patch from the cppyy inside ROOT in 8d2a6df, the built-in cppyy somehow doesn't support long long anymore. This only became apparent now that the Long64_t converter is only registered when setting up PyROOT.
Note that the reproducer works in upstream cppyy. Maybe because the type name "long long" is two words, and upstream cppyy somehow fixed it by patching ROOT meta?
It's not an urgent problem, because it's easy to fix by importing ROOT, but it would be nice to understand what is going on. Because maybe it means that once this problem with long long is fixed, we don't need the converter aliases for PyROOT at all!
Reproducer
import cppyy
# import ROOT # setting up PyROOT would fix the problem
# ROOT.gInterpreter
cppyy.cppdef("""
#include <cstdint>
namespace cool {
typedef long long Bad_t;
typedef std::int64_t Goot_t;
const Bad_t bad_value = +9223372036854775807;
const Goot_t good_value = +9223372036854775807;
}
""")
print(cppyy.gbl.cool.bad_value)
print(cppyy.gbl.cool.good_value)Will crash with:
Traceback (most recent call last):
File "/home/rembserj/repro.py", line 16, in <module>
print(cppyy.gbl.cool.bad_value)
^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: <namespace cppyy.gbl.cool at 0x64765cfce570> has no attribute 'bad_value'. Full details:
type object 'cool' has no attribute 'bad_value'
'cool::bad_value' is not a known C++ class
C++ type cannot be converted from memory. Did you mean: 'good_value'?ROOT version
ROOT master.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
Type
Projects
Status
No status