[vtk-developers] Handling deprecated methods in Python.

Andrew Maclean andrew.amaclean at gmail.com
Wed Sep 20 19:55:43 EDT 2017


What is the best way to handle deprecated methods?

I'm thinking of doing this:

try:
    windowToImageFilter.SetScale(1)
except NameError:
    print('windowToImageFilter.SetMagnification() is deeprecated in VTK8.1')
    windowToImageFilter.SetMagnification(1)

The thinking here is that if a deprecated method is ultimately removed,
this will still work.
​Any better ideas?​

-- 
___________________________________________
Andrew J. P. Maclean

___________________________________________
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/vtk-developers/attachments/20170921/c7c57107/attachment.html>


More information about the vtk-developers mailing list