utils.py 文件源码

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

项目:graphene-django 作者: graphql-python 项目源码 文件源码
def import_single_dispatch():
    try:
        from functools import singledispatch
    except ImportError:
        singledispatch = None

    if not singledispatch:
        try:
            from singledispatch import singledispatch
        except ImportError:
            pass

    if not singledispatch:
        raise Exception(
            "It seems your python version does not include "
            "functools.singledispatch. Please install the 'singledispatch' "
            "package. More information here: "
            "https://pypi.python.org/pypi/singledispatch"
        )

    return singledispatch
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号