Of course I would not consider adding C++ exceptions to VTK. It just could have been an option for Python, as you suggested above: sqrt(-1)
returns nan
in C++ but throws an exception in Python. But it seems we all agree on returning None
would be more convenient.
This is indeed a side effect of the new VTK property style wrapping, but it should not cause major trouble.
We have been calling all Get...
methods of VTK objects automatically in 3D Slicer’s Python console for years (for auto-completion) and the only thing we had to fix was suppressing error/warning messages. Occasionally we run into a crash during auto-complete due to calling a Get
function in an unexpected state, but it is very rare (we come across one in every few years) and the issue is easy to find and fix.