summaryrefslogtreecommitdiff
path: root/numpy/lib/utils.py
diff options
context:
space:
mode:
authorTravis Oliphant <oliphant@enthought.com>2006-06-15 03:39:43 +0000
committerTravis Oliphant <oliphant@enthought.com>2006-06-15 03:39:43 +0000
commit2f4a9678f04a3eab6878f4694231d4848e127490 (patch)
treed1d7288995146b78f63b643afe2af99b3ddb1087 /numpy/lib/utils.py
parent439ea9dc39d6ab0c4052b0881d0f6fed5e8c344f (diff)
downloadnumpy-2f4a9678f04a3eab6878f4694231d4848e127490.tar.gz
Expose deprecate function
Diffstat (limited to 'numpy/lib/utils.py')
-rw-r--r--numpy/lib/utils.py10
1 files changed, 9 insertions, 1 deletions
diff --git a/numpy/lib/utils.py b/numpy/lib/utils.py
index e64f5d978..92efe06d7 100644
--- a/numpy/lib/utils.py
+++ b/numpy/lib/utils.py
@@ -1,6 +1,6 @@
from numpy.core.numerictypes import obj2sctype
-__all__ = ['issubclass_', 'get_numpy_include', 'issubsctype']
+__all__ = ['issubclass_', 'get_numpy_include', 'issubsctype', 'deprecate']
def issubclass_(arg1, arg2):
try:
@@ -26,3 +26,11 @@ def get_numpy_include():
include_dirs = get_numpy_include_dirs()
assert len(include_dirs)==1,`include_dirs`
return include_dirs[0]
+
+def deprecate(func, oldname, newname):
+ import warnings
+ def newfunc(*args,**kwds):
+ warnings.warn("%s is deprecated, use %s" % (oldname, newname),
+ DeprecationWarning)
+ return func(*args, **kwds)
+ return newfunc