View Issue Details [ Jump to Notes ] | [ Print ] | ||||||||
ID | Project | Category | View Status | Date Submitted | Last Update | ||||
0015995 | VTK | (No Category) | public | 2016-02-12 17:20 | 2016-03-03 11:56 | ||||
Reporter | David Gobbi | ||||||||
Assigned To | David Gobbi | ||||||||
Priority | low | Severity | minor | Reproducibility | have not tried | ||||
Status | closed | Resolution | fixed | ||||||
Platform | OS | OS Version | |||||||
Product Version | 5.10.1 | ||||||||
Target Version | Fixed in Version | 7.1.0 | |||||||
Summary | 0015995: Python help() does not work on wrapped VTK templates | ||||||||
Description | Templates 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. | ||||||||
Tags | No tags attached. | ||||||||
Project | TBD | ||||||||
Type | incorrect functionality | ||||||||
Attached Files | |||||||||
Relationships | |
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 [^] |
Notes |
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 |
Issue History |
Copyright © 2000 - 2018 MantisBT Team |