Version 3.1.1 is a stable release with a long list of bug fixes. The repaired defects include: A fix to a crash caused by a dir() on an uninitialized module. A fix to a crash for bytearray.translate() with invalid parameters. A remedy for a data cor
A fix to a crash caused by a dir() on an uninitialized module. A fix to a crash for bytearray.translate() with invalid parameters. A remedy for a data corruption issue in the new I/O library. A patch to a segfault in Expat. A patch to a warnings.war
一、python3对文本和二进制数据做了区分。文本是Unicode编码,str类型,用于显示。二进制类型是bytes类型,用于存储和传输。bytes是byte的序列,而str是unicode的序列。
str类型:
>>> s = u'你好'
>>> s
'你好'
>>> type(s)
bytes类型:
>>> b = b'abc'
>>> b
b'abc'
>>>