Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 6d6861b

Browse filesBrowse files
authored
Merge pull request #14556 from anntzer/deprecated
Improve @deprecated's docstring.
2 parents ec8e119 + c73e831 commit 6d6861b
Copy full SHA for 6d6861b

File tree

Expand file treeCollapse file tree

1 file changed

+4
-11
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+4
-11
lines changed

‎lib/matplotlib/cbook/deprecation.py

Copy file name to clipboardExpand all lines: lib/matplotlib/cbook/deprecation.py
+4-11Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -135,15 +135,8 @@ def deprecated(since, *, message='', name='', alternative='', pending=False,
135135
object.
136136
137137
name : str, optional
138-
The name of the deprecated object; if not provided the name
139-
is automatically determined from the passed in object,
140-
though this is useful in the case of renamed functions, where
141-
the new function is just assigned to the name of the
142-
deprecated function. For example::
143-
144-
def new_function():
145-
...
146-
old_function = new_function
138+
The name used in the deprecation message; if not provided, the name
139+
is automatically determined from the deprecated object.
147140
148141
alternative : str, optional
149142
An alternative API that the user may use in place of the deprecated
@@ -155,8 +148,8 @@ def new_function():
155148
DeprecationWarning. Cannot be used together with *removal*.
156149
157150
obj_type : str, optional
158-
The object type being deprecated; by default, 'function' if decorating
159-
a function and 'class' if decorating a class.
151+
The object type being deprecated; by default, 'class' if decorating
152+
a class, 'attribute' if decorating a property, 'function' otherwise.
160153
161154
addendum : str, optional
162155
Additional text appended directly to the final message.

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.