Hacker News Best

Python 3.15

8.5内容质量

TL;DR · AI 摘要

Python 3.15.0发布,包含UTF-8默认编码、JIT性能提升等重大更新,影响跨平台开发与性能优化。

核心要点

  • UTF-8成为默认编码,提升跨平台文本处理兼容性
  • JIT编译器性能提升7-12%,优化计算密集型任务
  • macOS用户需注意tkinter应用可能因系统更新导致卡顿

结构提纲

按章节快速跳转。

  1. Python 3.15.0是2026年10月发布的重大版本,包含5643次提交的改进。

  2. 新增sentinel类型、UTF-8默认编码、JIT编译器性能提升7-12%。

  3. 新增Tachyon性能分析工具,增加颜色支持等改进。

  4. 启用frame pointers提升系统可观测性,Windows/macOS二进制文件调整。

  5. macOS 27.0用户需注意tkinter应用可能卡顿的问题。

思维导图

用一张图看清主题之间的关系。

查看大纲文本(无障碍 / 无 JS 友好)
  • Python 3.15.0新特性
    • 解释器改进
      • UTF-8默认编码 (PEP 686)
      • JIT性能优化 (7-12%提升)
      • Lazy imports (PEP 810)
    • 标准库增强
      • Tachyon性能分析工具 (PEP 799)
      • 颜色支持增强
    • 兼容性警告
      • macOS 27.0 tkinter卡顿问题

金句 / Highlights

值得收藏与分享的关键句。

  • Python 3.15的JIT编译器在x86-64 Linux上比标准解释器快7-8%,在AArch64 macOS上比尾调用解释器快11-12%。

    — 第3段

    ⬇︎ 下载 PNG𝕏 分享到 X
  • PEP 686使Python默认使用UTF-8编码,解决跨平台文本处理兼容性问题。

    — 第3段

    ⬇︎ 下载 PNG𝕏 分享到 X
  • macOS 27.0的系统行为变更可能导致tkinter应用出现卡顿,建议关注issue #158053。

    — 第5段

    ⬇︎ 下载 PNG𝕏 分享到 X
#Python#版本更新#性能优化#跨平台开发
打开原文

Python Release Python 3.15.0 | Python.org

Python 3.15.0

Release date: Oct. 9, 2026

This is the stable release of Python 3.15.0

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.

Major new features of the 3.15 series, compared to 3.14

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

Interpreter improvements

  • PEP 661 : Add sentinel built-in type
  • PEP 686 : Python now uses UTF-8 as the default encoding
  • PEP 798 : Unpacking in comprehensions
  • PEP 810 : Explicit lazy imports for faster startup times
  • PEP 814 : Add frozendict built-in type
  • PEP 829 : Package startup configuration files
  • The experimental JIT compiler has been significantly upgraded, with 7-8% geometric mean performance improvement on x86-64 Linux over the standard interpreter, and 11-12% speedup on AArch64 macOS over the tail-calling interpreter
  • Improved error messages

Significant improvements in the standard library

  • PEP 799 : A dedicated profiling package for organizing Python profiling tools
  • PEP 799 : Tachyon: High frequency statistical sampling profiler
  • More color

New typing features

  • PEP 728 : TypedDict with typed extra items
  • PEP 747 : Annotating type forms with TypeForm
  • PEP 800 : Disjoint bases in the type system

C API improvements

  • PEP 782 : A new PyBytesWriter C API to create a Python bytes object
  • PEP 788 : Protection against finalization in the C API
  • PEP 803, 820, 793 : Stable ABI for free-threaded builds and related C API

Build changes

  • PEP 831 : Frame pointers are enabled by default for improved system-level observability

Release changes

  • The official Windows 64-bit binaries now use the tail-calling interpreter
  • The official macOS binaries now install free-threading support by default

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

Attention macOS 27.0 IDLE or tkinter users

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.

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.

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.

More resources

  • Online documentation
  • PEP 790 , 3.15 release schedule
  • Report bugs at https://github.com/python/cpython/issues
  • Help fund Python directly (or via GitHub Sponsors ) and support the Python community

And now for something completely different

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

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”: From the README: A TUI text adventure through what’s new in Python 3.15. 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. 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. The easiest way to play it is to run: uvx --python 3.15 whatsnewt And yes, there are easter eggs

Enjoy the new release

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 .

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

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 .

Full Changelog

Files

macOS

Download macOS installer

Windows

Download Python install manager

Source release

Download XZ compressed source tarball

Version

Operating system

Description

File size

Sigstore

SBOM

SHA-256 checksum

Gzipped source tarball

Source release

41.7 MB

.sigstore

SPDX

code
438596cac081036d
3c1d532ab7e7335e
eb35567bc961749a
0d5797176db0db68

XZ compressed source tarball

34.0 MB

code
ba4bed1ba346b916
890b76d9e3204514
20aa69f6408997d3
3c66482eeae3d575

Android embeddable package (aarch64)

Android

23.1 MB

code
571e4cf4e0aee3d1
ab54a52ca3d4e684
5b85ec0bb327f7de
bfb873172f445dab

Android embeddable package (x86_64)

23.4 MB

code
2413d51948d612cf
42baefba25295bb8
3c2ed84df5726af6
fe5bde2dec5d87e7

iOS XCframework

iOS

80.6 MB

code
68e98ab35cc0643b
a3a227a8c7768da4
5c2a5e67dbe1bc26
598537e96680fd19

macOS installer

macOS

for macOS 10.15 and later

84.9 MB

code
7c7e7eca61cbfa5f
0c6f80cd594cddbf
d492f4e8b3fb87e3
d9fa1efebaec43ed

Windows installer (64-bit)

Windows

Recommended

43.3 MB

code
67d9a63eb145a34a
a939f02eadbf8c57
f21fcdd6decb901c
cac578d2d1f01d6f

Windows installer (32-bit)

41.6 MB

code
222f79df7d2d5653
871c09aef73dd776
23514a356ca7f4a4
f3ba5b9217e55e8a

Windows installer (ARM64)

42.6 MB

code
bb1c5123cc63d7bb
37962ea7bf65e2b0
6389be9e5d48b6b5
32346d42ae487c4f

Windows embeddable package (64-bit)

13.1 MB

code
a6999bcbcbe56f93
7159ef79c2630260
eca99f65f7860bc5
cd20430324079a44

Windows embeddable package (32-bit)

11.4 MB

code
da1ca8f1a491444b
2a227b898caa9c44
537ac27dcf27cff5
8347f3b4119f79ad

Windows embeddable package (ARM64)

12.4 MB

code
abedaa8460572f9b
ade5e332db5ee0dc
95c2dbf6c8dec687
a1f03c3e6cd7f7d4

Windows release manifest

Install with 'py install 3.15'

15.0 KB

code
ebbd6a12b77ee2cb
ba5bf9fbb034c609
c8336877823f7989
126be10a237c11df