[vtk-developers] BUG? Abstract classes not "available" under Python
Prabhu Ramachandran
prabhu_r at users.sf.net
Tue Jul 5 09:16:13 EDT 2005
Hi,
With VTK-Python from CVS I notice that abstract classes are not made
available to the user in the vtk namespace. For example under Python
vtk.vtkObjectBase is not available. Earlier one could do this:
print vtk.vtkObjectBase
This is no longer possible. However, with Python the bases are always
accessible, which means one could do the following:
print vtk.vtkObject.__bases__
(<vtkclass libvtkCommonPython.vtkObjectBase at 0x4046a410>,)
and still get to the vtkObjectBase class.
If one wants to organize/sort the VTK class hierarchy in Python, not
having vtk.vtkObjectBase is a pain. Not having the abstract bases in
the module is IMHO quite unPythonic. This also precludes the
possibility of someone deriving from an abstract base class. I admit
that this is probably an unlikely scenario but in some of my code I
parse the entire VTK class hierarchy and not having the bases in the
vtk module namespace is a pain. This also breaks backwards
compatibility and I am not sure if there are others who rely on the
availability of these classes.
Can this behavior be changed? What do the others think?
cheers,
prabhu
More information about the vtk-developers
mailing list