test_standard_library.py 文件源码

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

项目:packaging 作者: blockstack 项目源码 文件源码
def test_sys_intern(self):
        """
        Py2's builtin intern() has been moved to the sys module. Tests
        whether sys.intern is available.
        """
        from sys import intern
        if utils.PY3:
            self.assertEqual(intern('hello'), 'hello')
        else:
            # intern() requires byte-strings on Py2:
            self.assertEqual(intern(b'hello'), b'hello')
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号