Skip to content

Improve @deprecated's docstring. #14556

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 16, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 4 additions & 11 deletions lib/matplotlib/cbook/deprecation.py
Original file line number Diff line number Diff line change
Expand Up @@ -135,15 +135,8 @@ def deprecated(since, *, message='', name='', alternative='', pending=False,
object.

name : str, optional
The name of the deprecated object; if not provided the name
is automatically determined from the passed in object,
though this is useful in the case of renamed functions, where
the new function is just assigned to the name of the
deprecated function. For example::

def new_function():
...
old_function = new_function
The name used in the deprecation message; if not provided, the name
is automatically determined from the deprecated object.

alternative : str, optional
An alternative API that the user may use in place of the deprecated
Expand All @@ -155,8 +148,8 @@ def new_function():
DeprecationWarning. Cannot be used together with *removal*.

obj_type : str, optional
The object type being deprecated; by default, 'function' if decorating
a function and 'class' if decorating a class.
The object type being deprecated; by default, 'class' if decorating
a class, 'attribute' if decorating a property, 'function' otherwise.

addendum : str, optional
Additional text appended directly to the final message.
Expand Down