Skip to content

Instantly share code, notes, and snippets.

@stefanv
Created July 12, 2018 18:49
Show Gist options
  • Save stefanv/ab02b290cd63c1fd65ac1ff544cf60f7 to your computer and use it in GitHub Desktop.
Save stefanv/ab02b290cd63c1fd65ac1ff544cf60f7 to your computer and use it in GitHub Desktop.
In [3]: deprecated?
Init signature: deprecated(alt_func=None, behavior='warn', removed_version=None)
Docstring:
Decorator to mark deprecated functions with warning.
Adapted from <http://wiki.python.org/moin/PythonDecoratorLibrary>.
Parameters
----------
alt_func : str
If given, tell user what function to use instead.
behavior : {'warn', 'raise'}
Behavior during call to deprecated function: 'warn' = warn user that
function is deprecated; 'raise' = raise error.
removed_version : str
The package version in which the deprecated function will be removed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment