I am trying to mark a function as deprecated so that the script call is executed before it completes normally, but falls into the verification of the PyCharm static code. (There are several other questions about these failure warnings, but I think they preceded Python 2.6 when I believe that class-based exceptions were introduced.)
Here is what I have:
class Deprecated(DeprecationWarning): pass def save_plot_and_insert(filename, worksheet, row, col): """ Deprecated. Docstring ...<snip> """ raise Deprecated()
I understand that legacy warnings should allow code to run, but this code example actually stops when the function is called. When I remove the βraiseβ from the function body, the code is executed, but PyCharm does not mark the function call as deprecated.
What is the Pythonic method (2.7.x) for marking functions as deprecated?
Beachcomber
source share