Python 3.7.0 正式釋出,官方文件語種新增日韓法
阿新 • • 發佈:2018-12-24
Python 官網於 6 月 27 日釋出 v3.7.0 的更新說明。v3.7.0 是最近比較大的更新。此次釋出包含了諸多新特性和優化。
官網對新特性和優化的彙總:
新語法特性:
- PEP 563, postponed evaluation of type annotations.
向後不相容的語法更改:
- async 和 await 現在是保留關鍵字
新的庫模組:
- contextvars: PEP 567 – Context Variables
- dataclasses: PEP 557 – Data Classes
- importlib.resources
新的 built-in 特性:
- PEP 553, 新函式 breakpoint()
Python 資料模型改進:
- PEP 562, customization of access to module attributes.(訪問模組屬性,可以定製了)
- PEP 560, core support for typing module and generic types.
- the insertion-order preservation nature of dict objects has been declared to be an official part of the Python language spec.
標準庫中的重要改進:
- The asyncio module has received new features, significant usability and performance improvements. (asyncio 模組已經獲得了新功能,顯著的可用性和效能改進。)
- The time module gained support for functions with nanosecond resolution. (time 模組獲得了對納秒級解析度功能的支援)
CPython 實現的改進:
- Avoiding the use of ASCII as a default text encoding: 取消 ASCII 作為預設文字編碼
- PEP 538, legacy C locale coercion
- PEP 540, forced UTF-8 runtime mode
- PEP 552, deterministic .pycs
- the new development runtime mode
- PEP 565, improved DeprecationWarning handling
C API 改進:
- PEP 539, new C API for thread-local storage
文件改進:
- Python 官方文件的翻譯,新增日文版、法語版和韓語版;
其他詳情,請參閱 Python 官網說明:
https://docs.python.org/3.7/whatsnew/3.7.html