Skip to content

15995: Implement C++ templates as Python modules.

David Gobbi requested to merge dgobbi/vtk:15995-template-pydoc into master

The help() function was not working on wrapped class templates due to changes in the python inspect module. As a work-around, the PyVTKTemplate type has been re-imagined as a module that contains the instantiations of the template, since python module objects provide docstrings for pydoc. PyVTKTemplate still supports the mapping protocol as before, which allows lookup of the instantiated templates via the template arguments:

>>> # equivalent to vtkVector<double,3>(0.0)
>>> v = vtkVector[float,3](0.0)

Merge request reports