diff options
Diffstat (limited to 'numpy/lib/utils.py')
-rw-r--r-- | numpy/lib/utils.py | 10 |
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 |