Skip to content

Add custom pythonization callback to SmartRefVector

Add custom pythonization callback to SmartRefVector to avoid mapping of C++ operator() to python __getitem__

See also discussion here Fix taken from suggestion from here

Without this fix the command: python -c "import cppyy; a = cppyy.gbl.SmartRefVector('DataObject')(); a.emplace_back(); print(type(a[0]) )
will print:
<class cppyy.gbl.SmartRefVector<DataObject> at 0xd048c10>
But after fix:
<class cppyy.gbl.SmartRef<DataObject> at 0xd6565a0>

cc @clemenci

Merge request reports