Jean-François,
[quote=“jfcaron”]
void do_something(double x, double & y)
would have to be called in PyROOT with just one argument, and the return value given a name?[/quote]That would look like this:result = do_something(x, y)
with ‘y’ being any old float. This as opposed to:yref = ROOT.Double(y)
do_something(x, yref)
y = float(yref)
as is currently the case, or would be with a ctypes equivalent (actually, the ctypes is worse as its underlying types can’t participate as normal: you can use the ROOT.Double yref instead of y after the call, it’d just be slower).
Noel, I’m not seeing the conflict? True, one could now do (per above):do_something(x, 3.14)
which would be illegal in C++, but it’d still be perfectly safe.
As for ctypes, no: you create temporary python objects whereas the C++ ones are already created no matter what (to unbox the python object), so you don’t gain there. With the tuple return, there’s the creation/destruction of the tuple, so it’s probably a wash, but definitely nothing in favor of ctypes.
Thanks,
Wim