[vtk-developers] Handling deprecated methods in Python.

David Gobbi david.gobbi at gmail.com
Thu Sep 21 01:17:36 EDT 2017


Hi Andrew,

Deprecated methods already print a warning if they are declared with
VTK_LEGACY().  Is there a reason that we would want the methods to live
longer in Python than they do in C++?

 - David

On Wed, Sep 20, 2017 at 5:55 PM, Andrew Maclean <andrew.amaclean at gmail.com>
wrote:

> 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?​
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/vtk-developers/attachments/20170920/4da67b62/attachment.html>


More information about the vtk-developers mailing list