deserialize.py 文件源码

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

项目:nirum-python 作者: spoqa 项目源码 文件源码
def is_support_abstract_type(t):
    """FIXME: 3.5 only"""
    if hasattr(t, '__origin__') and t.__origin__:
        data_type = t.__origin__
    else:
        data_type = t
    abstract_types = {
        typing.Sequence,
        typing.List,
        typing.Set,
        typing.AbstractSet,
        typing.Mapping,
        typing.Dict,
    }
    return any(type_ is data_type for type_ in abstract_types)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号