(func)
return counted
统计递归函数执行次数
统计递归函数执行次数
统计递归函数执行次数
def count(func):
    """统计递归函数执行次数"""
    # @wraps(func)
    def counted(*args):
        counted.call_count += 1
        return func(*args)
    counted.call_count = 0
    return counted
def count ( func ) : # @wraps(func) def counted ( * args ) : counted . call_count += 1 return func ( * args ) counted . call_count = 0 return counted