<div dir="ltr">This problem is still happening, I've just tested it with Python 2.7.3 and VTK 5.10.1.<div><br></div><div style>I've debugged it inside CPython, and this is what I found:</div><div style><br></div><div style>
<div> In object.c(1100): calling PyObject_Hash(PyObject *v = vtkObject)<br></div><div><br></div><div> PyTypeObject *tp = v->ob_type; // tp is 'vtkclass' from 'vtkCommonPython'</div><div><br></div>
<div> It calls, in line 1111: PyType_Ready(tp)</div><div> </div><div> (Which seems it should've been called before)</div><div><br></div><div> In PyType_Ready, typeobject.c(4028), it calls:</div><div><br></div>
<div> mro_internal(type)</div><div><br></div><div> Which fails, because the type does not have the 'mro' attribute.</div><div><br></div><div><br></div><div style> I've created an issue here: <a href="http://vtk.org/Bug/view.php?id=14037">http://vtk.org/Bug/view.php?id=14037</a></div>
<div><br></div><div style> Thanks!</div><div><br></div></div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Wed, May 27, 2009 at 10:56 AM, Berk Geveci <span dir="ltr"><<a href="mailto:berk.geveci@kitware.com" target="_blank">berk.geveci@kitware.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">This is definitely not intentional. Furthermore, I can't reproduce it<br>
on cvs head. Do you know what caused the problem between 5.0.3 and<br>
5.0.4. Also, can you try 5.4 as I don't think we support 5.0 anymore?<br>
<span class="HOEnZb"><font color="#888888"><br>
-berk<br>
</font></span><div class="HOEnZb"><div class="h5"><br>
On Wed, May 27, 2009 at 1:19 AM, Carlos Scheidegger<br>
<<a href="mailto:cscheid@sci.utah.edu">cscheid@sci.utah.edu</a>> wrote:<br>
> Here's a simpler way to trigger the issue I just mentioned. The core problem<br>
> is related to generating a hash from the vtk class object. On VTK 5.0.3 (and<br>
> Python 2.5.2), I get this:<br>
><br>
>>>> import vtk<br>
>>>> hash(vtk.vtkObject)<br>
> 140169743808624<br>
>>>> id(vtk.vtkObject)<br>
> 140169743808624<br>
><br>
> This seems to me the correct behavior. On VTK 5.0.4 (and Python 2.6.2), I<br>
> get this:<br>
><br>
>>>> hash(vtk.vtkObject)<br>
> Traceback (most recent call last):<br>
> File "<stdin>", line 1, in <module><br>
> AttributeError: mro<br>
>>>> id(vtk.vtkObject)<br>
> 3083232608L<br>
><br>
> Is this an intended change? It is very convenient to use vtk classes in<br>
> python dictionaries...<br>
><br>
> Thanks!<br>
> -carlos<br>
> _______________________________________________<br>
> Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>
><br>
> Visit other Kitware open-source projects at<br>
> <a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
><br>
> Please keep messages on-topic and check the VTK FAQ at:<br>
> <a href="http://www.vtk.org/Wiki/VTK_FAQ" target="_blank">http://www.vtk.org/Wiki/VTK_FAQ</a><br>
><br>
> Follow this link to subscribe/unsubscribe:<br>
> <a href="http://www.vtk.org/mailman/listinfo/vtkusers" target="_blank">http://www.vtk.org/mailman/listinfo/vtkusers</a><br>
><br>
_______________________________________________<br>
Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>
<br>
Visit other Kitware open-source projects at <a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
<br>
Please keep messages on-topic and check the VTK FAQ at: <a href="http://www.vtk.org/Wiki/VTK_FAQ" target="_blank">http://www.vtk.org/Wiki/VTK_FAQ</a><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
<a href="http://www.vtk.org/mailman/listinfo/vtkusers" target="_blank">http://www.vtk.org/mailman/listinfo/vtkusers</a><br>
</div></div></blockquote></div><br></div>