Deprecates a function and includes the deprecation in its docstring. This function is used as a decorator. It returns an object that can be used to issue a DeprecationWarning, by passing the to-be decorated function as argument, this adds warning to the to-be decorated function's
(msg)
| 237 | |
| 238 | |
| 239 | def deprecate_with_doc(msg): |
| 240 | """ |
| 241 | Deprecates a function and includes the deprecation in its docstring. |
| 242 | |
| 243 | This function is used as a decorator. It returns an object that can be |
| 244 | used to issue a DeprecationWarning, by passing the to-be decorated |
| 245 | function as argument, this adds warning to the to-be decorated function's |
| 246 | docstring and returns the new function object. |
| 247 | |
| 248 | See Also |
| 249 | -------- |
| 250 | deprecate : Decorate a function such that it issues a `DeprecationWarning` |
| 251 | |
| 252 | Parameters |
| 253 | ---------- |
| 254 | msg : str |
| 255 | Additional explanation of the deprecation. Displayed in the |
| 256 | docstring after the warning. |
| 257 | |
| 258 | Returns |
| 259 | ------- |
| 260 | obj : object |
| 261 | |
| 262 | """ |
| 263 | return _Deprecate(message=msg) |
| 264 | |
| 265 | |
| 266 | #-------------------------------------------- |