@@ -73,31 +73,24 @@ def warn_deprecated(
73
73
----------
74
74
since : str
75
75
The release at which this API became deprecated.
76
-
77
76
message : str, optional
78
77
Override the default deprecation message. The ``%(since)s``,
79
78
``%(name)s``, ``%(alternative)s``, ``%(obj_type)s``, ``%(addendum)s``,
80
79
and ``%(removal)s`` format specifiers will be replaced by the values
81
80
of the respective arguments passed to this function.
82
-
83
81
name : str, optional
84
82
The name of the deprecated object.
85
-
86
83
alternative : str, optional
87
84
An alternative API that the user may use in place of the deprecated
88
85
API. The deprecation warning will tell the user about this alternative
89
86
if provided.
90
-
91
87
pending : bool, optional
92
88
If True, uses a PendingDeprecationWarning instead of a
93
89
DeprecationWarning. Cannot be used together with *removal*.
94
-
95
90
obj_type : str, optional
96
91
The object type being deprecated.
97
-
98
92
addendum : str, optional
99
93
Additional text appended directly to the final message.
100
-
101
94
removal : str, optional
102
95
The expected removal version. With the default (an empty string), a
103
96
removal version is automatically computed from *since*. Set to other
@@ -106,7 +99,7 @@ def warn_deprecated(
106
99
107
100
Examples
108
101
--------
109
- Basic example ::
102
+ ::
110
103
111
104
# To warn of the deprecation of "matplotlib.name_of_module"
112
105
warn_deprecated('1.4.0', name='matplotlib.name_of_module',
@@ -135,46 +128,13 @@ def deprecated(since, *, message='', name='', alternative='', pending=False,
135
128
``@deprecated`` would mess up ``__init__`` inheritance when installing its
136
129
own (deprecation-emitting) ``C.__init__``).
137
130
138
- Parameters
139
- ----------
140
- since : str
141
- The release at which this API became deprecated.
142
-
143
- message : str, optional
144
- Override the default deprecation message. The ``%(since)s``,
145
- ``%(name)s``, ``%(alternative)s``, ``%(obj_type)s``, ``%(addendum)s``,
146
- and ``%(removal)s`` format specifiers will be replaced by the values
147
- of the respective arguments passed to this function.
148
-
149
- name : str, optional
150
- The name used in the deprecation message; if not provided, the name
151
- is automatically determined from the deprecated object.
152
-
153
- alternative : str, optional
154
- An alternative API that the user may use in place of the deprecated
155
- API. The deprecation warning will tell the user about this alternative
156
- if provided.
157
-
158
- pending : bool, optional
159
- If True, uses a PendingDeprecationWarning instead of a
160
- DeprecationWarning. Cannot be used together with *removal*.
161
-
162
- obj_type : str, optional
163
- The object type being deprecated; by default, 'class' if decorating
164
- a class, 'attribute' if decorating a property, 'function' otherwise.
165
-
166
- addendum : str, optional
167
- Additional text appended directly to the final message.
168
-
169
- removal : str, optional
170
- The expected removal version. With the default (an empty string), a
171
- removal version is automatically computed from *since*. Set to other
172
- Falsy values to not schedule a removal date. Cannot be used together
173
- with *pending*.
131
+ Parameters are the same as for `warn_deprecated`, except that *obj_type*
132
+ defaults to 'class' if decorating a class, 'attribute' if decorating a
133
+ property, and 'function' otherwise.
174
134
175
135
Examples
176
136
--------
177
- Basic example ::
137
+ ::
178
138
179
139
@deprecated('1.4.0')
180
140
def the_function_to_deprecate():
0 commit comments