Python 3.15

Python 3.15

Notice: This page displays a fallback because interactive scripts did not run. Possible causes include disabled JavaScript or failure to load scripts or stylesheets.

注意:由于交互式脚本未运行,此页面显示为回退版本。可能的原因包括禁用了 JavaScript,或脚本/样式表加载失败。

Release date: Oct. 9, 2026

发布日期:2026 年 10 月 9 日

Python 3.15.0 is the newest major release of the Python programming language, and it contains many new features and optimisations compared to Python 3.14, in 5,643 commits from 1,012 contributors.

Python 3.15.0 是 Python 编程语言的最新主要版本。与 Python 3.14 相比,它包含许多新功能和优化,由 1,012 名贡献者提交了 5,643 次代码变更。

Some of the major new features and changes in Python 3.15 are:

Python 3.15 的一些主要新功能和变更包括:

For more details on the changes to Python 3.15, see What’s new in Python 3.15.

有关 Python 3.15 变更的更多详细信息,请参阅“Python 3.15 有什么新功能”。

When running IDLE or other GUI applications that use the tkinter module, these applications may hang when using an application’s menu command that opens a dialog (for example, IDLE’s About IDLE, Settings, and Open Module commands) resulting in a spinning beach ball with Force Quit needed.

在运行 IDLE 或其他使用 tkinter 模块的 GUI 应用程序时,如果使用打开对话框的应用程序菜单命令(例如 IDLE 的“关于 IDLE”、“设置”和“打开模块”命令),这些应用程序可能会挂起,导致出现旋转的彩球,并需要强制退出。

This problem is due to an operating system behavior change in macOS 27.0 that is believed to affect all current versions of the Tk graphics toolkit and thus the tkinter module in all current Python versions.

此问题是由于 macOS 27.0 中的操作系统行为变更所致,据信该变更会影响 Tk 图形工具包的所有当前版本,从而影响所有当前 Python 版本中的 tkinter 模块。

If you depend on Tk-based applications (like IDLE) on macOS, you may want to consider deferring installing macOS 27.0 until a Tk or macOS workaround is available or testing that your application workflow is not affected. Follow issue #158053 for updates.

如果您在 macOS 上依赖基于 Tk 的应用程序(如 IDLE),您可能需要考虑推迟安装 macOS 27.0,直到有 Tk 或 macOS 的解决方案可用,或者测试您的应用程序工作流程是否受到影响。请关注问题 #158053 以获取更新。

To celebrate the new 3.15, Barry Warsaw has a present for us!

为了庆祝新的 3.15 版本,Barry Warsaw 为我们准备了一份礼物!

I had this idea to whip up a little TUI adventure game that takes you through a What’s New in Python 3.15. I present to you “whatsnewt”:

我萌生了一个想法,制作一个小型的 TUI(终端用户界面)冒险游戏,带你了解 Python 3.15 的新功能。我向大家介绍“whatsnewt”:

A TUI text adventure through what’s new in Python 3.15.

一个带你探索 Python 3.15 新功能的 TUI 文字冒险游戏。

You wake up in the Startup Foyer, somewhere inside the interpreter, and work your way to the Release Gate. Along the way there are eighteen puzzles, and every one of them is a real 3.15 feature you have to actually use. You’re not just answering boring questions, you’re actually writing and running code, in a Python 3.15 interpreter.

你在解释器内部某处的“启动门厅”中醒来,并设法前往“发布之门”。沿途有十八个谜题,每一个都是你必须实际使用的真实 3.15 功能。你不仅仅是在回答枯燥的问题,而是在 Python 3.15 解释器中实际编写和运行代码。

Some puzzles require a type checker, and in those cases, answers are verified by pyrefly, which is a dependency for exactly that reason, and the verdict quotes what it says back.

有些谜题需要类型检查器,在这种情况下,答案由 pyrefly 验证(它正是为此目的而作为依赖项引入的),判定结果会引用其反馈信息。

The easiest way to play it is to run:

运行以下命令是体验它的最简单方法:

uvx —python 3.15 whatsnewt

uvx —python 3.15 whatsnewt

And yes, there are easter eggs

没错,里面还有彩蛋。

Thanks to all of the many volunteers who help make Python development and these releases possible! Please consider supporting our efforts by volunteering yourself or through organisation contributions to the Python Software Foundation.

感谢所有帮助实现 Python 开发和这些版本发布的志愿者!请考虑通过志愿服务或通过向 Python 软件基金会进行组织捐赠来支持我们的工作。

Huge thanks to Georgi Ker and Marie Nordin for the Python 3.15 logo!

非常感谢 Georgi Ker 和 Marie Nordin 设计了 Python 3.15 的标志!

And also huge thanks to the Sovereign Tech Agency for supporting Hugo van Kemenade’s work as release manager for Python 3.14 and 3.15 through the Sovereign Tech Fellowship.

同时也非常感谢 Sovereign Tech Agency 通过 Sovereign Tech Fellowship 支持 Hugo van Kemenade 担任 Python 3.14 和 3.15 的发布经理。

Download macOS installer

下载 macOS 安装程序

Download Python install manager

下载 Python 安装管理器

Download XZ compressed source tarball

下载 XZ 压缩的源代码压缩包