request.py 文件源码

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

项目:lantern-detection 作者: gongxijun 项目源码 文件源码
def webpyfunc(inp, fvars, autoreload=False):
    """If `inp` is a url mapping, returns a function that calls handle."""
    if not hasattr(inp, '__call__'):
        if autoreload:
            # black magic to make autoreload work:
            mod = __import__(fvars['__name__'], None, None, [""])
            #@@probably should replace this with some inspect magic
            name = utils.dictfind(fvars, inp)
            func = lambda: handle(getattr(mod, name), mod)
        else:
            func = lambda: handle(inp, fvars)
    else:
        func = inp
    return func
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号