Good timing on your question! We have just finished an improvement of the capability of the RDataFrame Snapshot such that it won’t be necessary anymore to specify any template arguments at all. At the same time, this will also not require any JIT-compiling. That practically means that you get the benefit of a simpler API (i.e. no need to care about template arguments) with a much, much faster runtime performance.
The change has just been merged to the development branch of ROOT, so it’s going to be available in the next ROOT version 6.38 scheduled for end of this year. In the meanwhile, if you have access to an LCG release via CVMFS, for example using lxplus, you can already see this in action. You can source the environment via e.g.
In the meanwhile, you might want to hang tight and use the Snapshot API without template arguments, which for now will still be slower but it’s also going to require zero code-changes for you after the update to 6.38. The template overload will be deprecated and slowly phased out.
Lastly, I still believe your question is interesting from a generic Python-C++ interoperability standpoint, so here it goes. If you have any function template in C++, you can call it in Python with the [] syntax, for example:
So you can use the same syntax also in the case of the template Snapshot, although as I mentioned above this template will be removed in a future version of ROOT.