summaryrefslogtreecommitdiff
path: root/numpy/lib/utils.py
diff options
context:
space:
mode:
Diffstat (limited to 'numpy/lib/utils.py')
-rw-r--r--numpy/lib/utils.py9
1 files changed, 9 insertions, 0 deletions
diff --git a/numpy/lib/utils.py b/numpy/lib/utils.py
index 92efe06d7..1304adb42 100644
--- a/numpy/lib/utils.py
+++ b/numpy/lib/utils.py
@@ -33,4 +33,13 @@ def deprecate(func, oldname, newname):
warnings.warn("%s is deprecated, use %s" % (oldname, newname),
DeprecationWarning)
return func(*args, **kwds)
+ newfunc.__name__ = oldname
+ doc = func.__doc__
+ depdoc = '%s is DEPRECATED in numpy: use %s instead' % (oldname, newname,)
+ if doc is None:
+ doc = depdoc
+ else:
+ doc = '\n'.join([depdoc, doc])
+ newfunc.__doc__ = doc
+ newfunc.__dict__.update(func.__dict__)
return newfunc