str 和 unicode
以下摘自《Effective Python》
python3
有两种表示字符序列的类型:bytes 和 str。前者的实例包含原始的8位值;后者的实例包含Unicode字符。
python2
中也有两种表示字符序列的类型,分别叫做 str 和 unicode 。与 python3 不同的是,str 的实例包含原始的8位值,而 unicode 的实例,则包含 Unicode 字符。
下图辅助理解。



以下可复制:
def to_unicode(unicode_or_str)