decorators.py 文件源码

python
阅读 25 收藏 0 点赞 0 评论 0

项目:leetcode 作者: thomasyimgit 项目源码 文件源码
def apply_wrapper(wrapper, func):
    """Apply a wrapper to a function for decoration.

    This mixes Michele Simionato's decorator tool with nose's make_decorator,
    to apply a wrapper in a decorator so that all nose attributes, as well as
    function signature and other properties, survive the decoration cleanly.
    This will ensure that wrapped functions can still be well introspected via
    IPython, for example.
    """
    warnings.warn("The function `apply_wrapper` is deprecated since IPython 4.0",
            DeprecationWarning, stacklevel=2)
    import nose.tools

    return decorator(wrapper,nose.tools.make_decorator(func)(wrapper))
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号