[vtk-developers] Safer item access in Python wrapped VTK arrays
Andras Lasso
lasso at queensu.ca
Fri Aug 4 11:53:45 EDT 2017
Hi David,
Users who mostly use VTK via Python wrapping are sometimes surprised how easily they can crash the application by accessing out-of-bounds elements in arrays. For example, this crashes an application:
>>> a=vtk.vtkStringArray()
>>> print(a.GetValue(0))
I first thought that it should be handled by documentation and training, but it would be nicer if the wrappers could handle this.
Would it be feasible to add bounds check to VTK array accessors in Python wrappers, so that in case of an out of bounds access, a Python exception would be raised instead of crashing the application?
Andras
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/vtk-developers/attachments/20170804/5b5c3c94/attachment.html>
More information about the vtk-developers
mailing list