Is there a way to write pythonizations in cppyy that work for all templates?
I have a class in C++ that requires a template
template <typename TValueType>
Bound<TValueType> Bound<TValueType>::buildInclusiveBound(TValueType value) {
return Bound<TValueType>{BoundCategory::Inclusive, value};
}
I noticed that when I was writing a pythonization of this function, this did not work
import cppyy.gbl as Cpp
Cpp.Bound.__str__ = lambda self: "test"
but
import cppyy.gbl as Cpp
Cpp.Bound['double'].__str__ = lambda self: "test"
did.