py3compat.py 文件源码

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

项目:mongodb-monitoring 作者: jruaux 项目源码 文件源码
def b(s):
        # BSON and socket operations deal in binary data. In
        # python 3 that means instances of `bytes`. In python
        # 2.6 and 2.7 you can create an alias for `bytes` using
        # the b prefix (e.g. b'foo').
        # See http://python3porting.com/problems.html#nicer-solutions
        return codecs.latin_1_encode(s)[0]
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号