Functors grammar.py doesn't handle type `long`
I'm on a bit of a Frankenstein stack, which is why we don't see this in the nightlies.
Consider the following snippet from the moore lumi line
def odin_lumi_filter(make_odin=make_odin):
lumi_bit = cppyy.gbl.LHCb.ODIN.Lumi
def input_transform(InputLocation):
return {"Cut": fmath.test_bit(EVENTTYPE(InputLocation), lumi_bit)}
odin = make_odin()
return VoidFilter(InputLocation=odin, input_transform=input_transform)
In C++ lumi_bit
is the underlying type of the Enum EventTypes
defined here, thus unsigned integer
in this case.
Now in python this can either become int
or long
.
We expect int
and then calling bind_if_needed will work as expected.
But there are ways this will translate to long
in which case the logic in grammar.py doesn't cope and throws an error.
What one needs for this to show up:
ROOT with cppyy version 1.6.2 (e.g. ROOT 6.22.06 or higher).
In 1.6.2 cppyy introduced proper handling of underlying types of Enums previously it was just always int
.
But you also need Python2 which has long
as builtin. In Python 3 long
isn't a thing anymore.
That's why we don't see this in the nightlies.
There we are on python2 + older ROOT or newer ROOT + Python 3
@rmatev or @clemenci are we planning on using any of the newer LCG releases with python2 or is the current LCG_97a cycle our last one on python2?