[vtk-developers] Problem with Python wrappers

Prabhu Ramachandran prabhu at aero.iitb.ac.in
Fri Jul 15 02:01:47 EDT 2011


Hi,

It has been a while since I pulled from upstream and I had noticed some 
changes by David Gobbi to the Python wrappers. I found one issue that I 
think is important.  The new support for wrapping templates seems rather 
unPythonic to me.  Here is a simple example:

 >>> import vtk
 >>> print vtk.vtkVector2i.__bases__
(<type 'vtkVector2[int32]'>,)

Now the name of the type for this class is actually illegal in Python. 
This causes all kinds of problems when you want to parse the VTK class 
hierarchy.  The trouble is, you cannot find the 'vtkVector2[int32]' in 
the vtk module nor can you instantiate it that way.  This makes the 
class hierarchy actually inconsistent in Python, i.e. you cannot walk up 
a class inheritance tree and replicate that with the vtk module.  Can 
the base class be simply changed to vtkVector2 which can't be 
instantiated but exists in the vtk module.  The name is also perfectly 
legal.  I would appreciate it if this were changed.  Thanks!

regards,
-- 
Prabhu Ramachandran                 http://www.aero.iitb.ac.in/~prabhu



More information about the vtk-developers mailing list