__init__.py 文件源码

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

项目:deb-python-traceback2 作者: openstack 项目源码 文件源码
def _some_str(value):
    try:
        if PY2:
            # If there is a working __unicode__, great.
            # Otherwise see if we can get a bytestring...
            # Otherwise we fallback to unprintable.
            try:
                return unicode(value)
            except:
                return "b%s" % repr(str(value))
        else:
            # For Python3, bytestrings don't implicit decode, so its trivial.
            return str(value)
    except:
        return '<unprintable %s object>' % type(value).__name__

# --
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号