From 5afe45fbadbddd86585ae1a3670142ba30bab4ea Mon Sep 17 00:00:00 2001 From: Antony Lee Date: Wed, 8 Jun 2016 02:22:26 -0700 Subject: [PATCH] Fix docstrings for `warn_deprecated`. The doc for the `name` kwarg was probably incorrectly copypasted from the doc in the `deprecated` decorator. Added a missing `%()s` format specifier; rewrapped a line. --- lib/matplotlib/cbook.py | 22 +++++++--------------- 1 file changed, 7 insertions(+), 15 deletions(-) diff --git a/lib/matplotlib/cbook.py b/lib/matplotlib/cbook.py index 89ba9c11ea4..5f4db526fdd 100644 --- a/lib/matplotlib/cbook.py +++ b/lib/matplotlib/cbook.py @@ -95,24 +95,16 @@ def warn_deprecated( specifier `%(func)s` may be used for the name of the function, and `%(alternative)s` may be used in the deprecation message to insert the name of an alternative to the deprecated - function. `%(obj_type)` may be used to insert a friendly name + function. `%(obj_type)s` may be used to insert a friendly name for the type of object being deprecated. name : str, optional - The name of the deprecated function; if not provided the name - is automatically determined from the passed in function, - 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(): - ... - oldFunction = new_function + The name of the deprecated object. alternative : str, optional An alternative function that the user may use in place of the - deprecated function. The deprecation warning will tell the user about - this alternative if provided. + deprecated function. The deprecation warning will tell the user + about this alternative if provided. pending : bool, optional If True, uses a PendingDeprecationWarning instead of a @@ -153,7 +145,7 @@ def deprecated(since, message='', name='', alternative='', pending=False, specifier `%(func)s` may be used for the name of the function, and `%(alternative)s` may be used in the deprecation message to insert the name of an alternative to the deprecated - function. `%(obj_type)` may be used to insert a friendly name + function. `%(obj_type)s` may be used to insert a friendly name for the type of object being deprecated. name : str, optional @@ -169,8 +161,8 @@ def new_function(): alternative : str, optional An alternative function that the user may use in place of the - deprecated function. The deprecation warning will tell the user about - this alternative if provided. + deprecated function. The deprecation warning will tell the user + about this alternative if provided. pending : bool, optional If True, uses a PendingDeprecationWarning instead of a