View Issue Details Jump to Notes ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0015995VTK(No Category)public2016-02-12 17:202016-03-03 11:56
ReporterDavid Gobbi 
Assigned ToDavid Gobbi 
PrioritylowSeverityminorReproducibilityhave not tried
StatusclosedResolutionfixed 
PlatformOSOS Version
Product Version5.10.1 
Target VersionFixed in Version7.1.0 
Summary0015995: Python help() does not work on wrapped VTK templates
DescriptionTemplates such as vtkVector and vtkTuple are wrapped into python as simple dict-like template objects that map the template parameters to instantiated templates (i.e. classes). The python wrappers give these template objects a __doc__ attribute, which the Python 2.5 help() method would use to provide user-level documentation.

However, in Python 2.7 and above, this __doc__ attribute is ignored because these template objects are not classes. Therefore, the help() method does not show the documentation.
TagsNo tags attached.
ProjectTBD
Typeincorrect functionality
Attached Files

 Relationships

  Notes
(0035734)
David Gobbi (developer)
2016-02-12 17:53

The problem is specifically due to a set of checks in the pydoc.render_doc() method. It only renders the docstring if one of these "inspect" methods returns true: ismodule, isclass, isroutine, isgetsetdescriptor, ismemberdescriptor, or if not object is a property. These template objects are "none of the above".

Option 1: make these objects into modules (i.e. a module containing the instantiated class templates). A module that supports the mapping protocol would be very easy to implement. Usage: vtk.vtkVector[float, 3] which is the currently used syntax.

Option 2: make these objects into metaclasses. This suggests a different syntax: vtk.vtkVector(float, 3) would return the vtkVector3f class. I don't want to change the syntax, and the implementation of this would be tricky.
(0035738)
David Gobbi (developer)
2016-02-15 16:46

https://gitlab.kitware.com/vtk/vtk/merge_requests/1218 [^]

 Issue History
Date Modified Username Field Change
2016-02-12 17:20 David Gobbi New Issue
2016-02-12 17:20 David Gobbi Assigned To => David Gobbi
2016-02-12 17:53 David Gobbi Note Added: 0035734
2016-02-12 17:53 David Gobbi Description Updated
2016-02-15 16:46 David Gobbi Note Added: 0035738
2016-02-15 16:46 David Gobbi Status backlog => gerrit review
2016-03-03 11:56 David Gobbi Status gerrit review => closed
2016-03-03 11:56 David Gobbi Resolution open => fixed
2016-03-03 11:56 David Gobbi Fixed in Version => 7.1.0


Copyright © 2000 - 2018 MantisBT Team