_types.py 文件源码

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

项目:pyShadowsocks 作者: FTwOoO 项目源码 文件源码
def type_name(value):
    """
    Returns a user-readable name for the type of an object

    :param value:
        A value to get the type name of

    :return:
        A unicode string of the object's type name
    """

    if inspect.isclass(value):
        cls = value
    else:
        cls = value.__class__
    if cls.__module__ in set(['builtins', '__builtin__']):
        return cls.__name__
    return '%s.%s' % (cls.__module__, cls.__name__)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号