Python 3.12.0
发布日期: 2023年10月2日
这是 Python 3.12.0 的稳定版本
Python 3.12.0 是 Python 编程语言的最新主要版本,它包含了许多新特性和优化。
与 3.11 相比,3.12 系列的主要新功能
新特性
- 更灵活的 f-string 解析,允许许多以前不允许的写法 (PEP 701)。
- 在 Python 代码中支持缓冲区协议 (PEP 688)。
- 新的调试/分析 API (PEP 669)。
- 支持带有独立全局解释器锁的隔离子解释器 (PEP 684)。
- 错误消息的进一步改进。更多可能由拼写错误引起的异常现在会向用户提供建议。
- 支持 Linux
perf分析器在追踪信息中报告 Python 函数名。 - 许多大大小小的性能改进(例如 PEP 709 和对 BOLT 二进制优化器的支持),预计整体性能提升 5%。
类型注解
- 用于泛型类的新类型注解语法 (PEP 695)。
- 用于方法的新的 @override 装饰器 (PEP 698)。
弃用
- 根据 PEP 623,unicode 对象的 C 实现中已弃用的
wstr和wstr_length成员已被移除。 - 在
unittest模块中,一些长期弃用的方法和类已被移除。(它们自 Python 3.1 或 3.2 起就已被弃用)。 - 已弃用的
smtpd和distutils模块已被移除(参见 PEP 594 和 PEP 632)。setuptools包继续提供distutils模块。 - 一些其他陈旧、损坏和已弃用的函数、类和方法已被移除。
- 字符串中无效的反斜杠转义序列现在会发出
SyntaxWarning警告,而不是DeprecationWarning,使其更加显眼。(它们将来会成为语法错误。) - 为准备性能增强,整数的内部表示已发生变化。(这不应影响大多数用户,因为它是一个内部细节,但可能会给 Cython 生成的代码带来问题。)
有关 Python 3.12 变更的更多详情,请参见“Python 3.12 的新变化”。
更多资源
- 在线文档.
- PEP 693,Python 3.12 发布时间表。
- 通过 GitHub Issues 报告错误。
- 帮助资助 Python 及其社区.
接下来是些完全不一样的内容
They have no need of our help
So do not tell me
These haggard faces could belong to you or me
Should life have dealt a different hand
We need to see them for who they really are
Chancers and scroungers
Layabouts and loungers
With bombs up their sleeves
Cut-throats and thieves
They are not
Welcome here
We should make them
Go back to where they came from
They cannot
Share our food
Share our homes
Share our countries
Instead let us
Build a wall to keep them out
It is not okay to say
These are people just like us
A place should only belong to those who are born there
Do not be so stupid to think that
The world can be looked at another way
(now read from bottom to top)
《难民》,作者:Brian Bilston。
文件
| 版本 | 操作系统 | 描述 | MD5 校验和 | 文件大小 | Sigstore | GPG | |
|---|---|---|---|---|---|---|---|
| Gzip 压缩的源码包 | 源码发布版 | d6eda3e1399cef5dfde7c4f319b0596c | 25.9 MB | .sigstore | SIG | ||
| XZ 压缩的源码包 | 源码发布版 | f6f4616584b23254d165f4db90c247d6 | 19.6 MB | .sigstore | SIG | ||
| macOS 64 位 universal2 安装程序 | macOS | 适用于 macOS 10.9 及更高版本 | eddf6f35a3cbab94f2f83b2875c5fc27 | 43.3 MB | .sigstore | SIG | |
| Windows 安装程序 (64位) | Windows | 推荐 | 32ab6a1058dfbde76951b7aa7c2335a6 | 25.3 MB | .sigstore | SIG | |
| Windows 安装程序 (32位) | Windows | de59862985bf7afa639f2e4f9e2a722c | 24.0 MB | .sigstore | SIG | ||
| Windows 安装程序 (ARM64) | Windows | 实验性 | 230c703e3b8b3d92765d118afa7b2f78 | 24.5 MB | .sigstore | SIG | |
| Windows 可嵌入包 (64位) | Windows | 8e24d2b26a8dbf1da0694b9da1a08b2c | 10.5 MB | .sigstore | SIG | ||
| Windows 可嵌入包 (32位) | Windows | c2047dc270c4936f9c64619bb193b721 | 9.4 MB | .sigstore | SIG | ||
| Windows 可嵌入包 (ARM64) | Windows | 3da91ef1a86a8a210a32ea99c709dd93 | 9.8 MB | .sigstore | SIG | ||
