整理|suiling
Python官网信息显示,目前Python 3.8仍处于开发阶段,该版本将会发布4个预览版,此次发布的是首个预览版。为了更快地进行优化和bug修复,Python官网建议第三方Python项目维护者使用Python 3.8进行测试。不过由于目前尚处于开发阶段,到正式版发布之前仍会对功能进行调整,所以官方不建议开发者在生产环境中使用测试版,以免给工作造成不便。
与Python 3.7版本相比,3.8系列的主要新功能和更改包括:
- PEP 572, Assignment expressions
https://www.python.org/dev/peps/pep-0572/
- PEP 570, Positional-only arguments
https://www.python.org/dev/peps/pep-0570/
- PEP 587, Python Initialization Configuration (improved embedding)
https://www.python.org/dev/peps/pep-0587/
- PEP 590, Vectorcall: a fast calling protocol for CPython
https://www.python.org/dev/peps/pep-0587/
- PEP 578, Runtime audit hooks
https://www.python.org/dev/peps/pep-0587/
- PEP 574, Pickle protocol 5 with out-of-band data
https://www.python.org/dev/peps/pep-0574/
- Typing-related: PEP 591 (Final qualifier), PEP 586 (Literal types), and PEP 589 (TypedDict)
- Parallel filesystem cache for compiled bytecode
- Debug builds share ABI as release builds
- f-strings support a handy = specifier for debugging
- continue is now legal in finally: blocks
- on Windows, the default asyncio event loop is now ProactorEventLoop
- on macOS, the spawn start method is now used by default in multiprocessing
- multiprocessing can now use shared memory segments to avoid pickling costs between processes
- typed_ast is merged back to CPython
- LOAD_GLOBAL is now 40% faster
- pickle now uses Protocol 4 by default, improving performance
- (Hey, fellow core developer, if a feature you find important is missing from this list, let ukasz know.)
此外,新版本中还有其他一些有趣的改变,详情请查看文档的"What's New" 页面。
同时,Python官网还预告,将会在7月1日发布第二个测试版本。
更多信息,请在官网查看:
https://www.python.org/downloads/release/python-380b1/
(*本文由Python大本营整理,转载请联系微信1092722531)
◆
精彩推荐
◆
![]()
推荐阅读
你点的每个“在看”,我都认真当成了喜欢
|
|