Python 3.5 新特性预览
腾讯SNG夏日招聘集结号:200个空缺岗位,JAVA、C++、云计算、Android……Python 3.5b1 已经发布,Python 3.5 正式版已经不远啦!Python 3.5 相比 Python 3.4 详细改进请看 Misc/NEWS。
Python 3.5 发布计划:
[*] 3.5.0 alpha 1: February 8, 2015
[*] 3.5.0 alpha 2: March 9, 2015
[*] 3.5.0 alpha 3: March 29, 2015
[*] 3.5.0 alpha 4: April 19, 2015
[*] 3.5.0 beta 1: May 24, 2015
[*] 3.5.0 beta 2: May 31, 2015
[*] 3.5.0 beta 3: July 5, 2015
[*] 3.5.0 beta 4: July 26, 2015
[*] 3.5.0 candidate 1: August 9, 2015
[*] 3.5.0 candidate 2: August 23, 2015
[*] 3.5.0 candidate 3: September 6, 2015
[*] 3.5.0 final: September 13, 2015
(Beta 1 已经是 "feature freeze" 状态,往后版本不会再添加新特性)
值得关注的新特性
新语法特性:
[*] PEP 465 新矩阵乘法运算符: a @ b.
[*] PEP 492 异步协同和 await 语法
新模块:
[*] zipapp: 改进 Python ZIP 应用支持 (PEP 441).
新内置特性:
[*] bytes % args, bytearray % args: PEP 461 - Adding % formattingto bytes and bytearray
[*] b'\xf0\x9f\x90\x8d'.hex(), bytearray(b'\xf0\x9f\x90\x8d').hex(),memoryview(b'\xf0\x9f\x90\x8d').hex(): issue 9951 - A hex methodhas been added to bytes, bytearray, and memoryview.
改进:
[*] When the LC_TYPE locale is the POSIX locale (C locale),sys.stdin and sys.stdout are now using thesurrogateescape error handler, instead of the strict error handler(issue 19977).
[*] PEP 488, the elimination of .pyo files.
[*] PEP 489, multi-phase initialization of extension modules.
值得关注的库模块改进:
[*] collections.OrderedDict 已经用 C 实现
[*] 可以传递字节到 tempfile 模块的 API,然后返回字节的临时路径名而不是 str 的临时路径名
Python 3.5 详细改进说明请看这里。
页:
[1]