[vtk-developers] More on VTK 5.0.4: hashing vtk class objects broken?

Carlos Scheidegger cscheid at sci.utah.edu
Wed May 27 01:19:02 EDT 2009


Here's a simpler way to trigger the issue I just mentioned. The core problem 
is related to generating a hash from the vtk class object. On VTK 5.0.3 (and 
Python 2.5.2), I get this:

 >>> import vtk
 >>> hash(vtk.vtkObject)
140169743808624
 >>> id(vtk.vtkObject)
140169743808624

This seems to me the correct behavior. On VTK 5.0.4 (and Python 2.6.2), I get 
this:

 >>> hash(vtk.vtkObject)
Traceback (most recent call last):
   File "<stdin>", line 1, in <module>
AttributeError: mro
 >>> id(vtk.vtkObject)
3083232608L

Is this an intended change? It is very convenient to use vtk classes in python 
dictionaries...

Thanks!
-carlos



More information about the vtk-developers mailing list