Python wrapper is confused by VTK singletons
Currently, the Python wrappers expect New() to return a new VTK object, and every time they call New() they create a new Python object instead of checking whether the VTK object already has a Python object. Here is an example for the singleton class vtkOutputWindow:
>>> import vtk
>>> o1 = vtk.vtkOutputWindow()
>>> hex(id(o1)) # address of Python object
'0x10d97ff58'
>>> o1.__this__ # address of VTK object
'_00007ff1e1586320_p_vtkOutputWindow'
>>> o2 = vtk.vtkOutputWindow()
>>> hex(id(o2)) # address of Python object
'0x10e060050'
>>> o2.__this__ # address of VTK object
'_00007ff1e1586320_p_vtkOutputWindow'
>>> o1 is o2
False
The two objects o1 and o2 are different Python objects, even though they are the same VTK object. This is bad.
The code that needs to be fixed is PyVTKObject_FromPointer() in PyVTKObject.cxx. The above snippet of Python code can be adapted to serve as a test.