def deprecated(fun_name=None, msg=""):
    '''Issue a deprecation warning for a function'''
    def _deprecated(fun):
        '''Issue a deprecation warning for a function'''
        @wraps(fun)
        def _wrapper(*args, **kwargs):
            '''Issue deprecation warning and forward arguments to fun'''
            name = fun_name if fun_name is not None else fun.__name__
            _warn_deprecated('Call to deprecated function %s. %s' % (name, msg))
            return fun(*args, **kwargs)

        return _wrapper

    return _deprecated
def deprecated ( fun_name = None , msg = "" ) : def _deprecated ( fun ) : @ wraps ( fun ) def _wrapper ( * args , ** kwargs ) : name = fun_name if fun_name is not None else fun . __name__ _warn_deprecated ( 'Call to deprecated function %s. %s' % ( name , msg ) ) return fun ( * args , ** kwargs ) return _wrapper return _deprecated
Issue a deprecation warning for a function