Skip to content

Commit 22a38bb

Browse files
committed
pythongh-149202: Highlight PEP 831 in What's New for Python 3.15
1 parent 301eb4b commit 22a38bb

1 file changed

Lines changed: 35 additions & 0 deletions

File tree

Doc/whatsnew/3.15.rst

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,8 @@ Summary -- Release highlights
7373
profiling tools <whatsnew315-profiling-package>`
7474
* :pep:`799`: :ref:`Tachyon: High frequency statistical sampling profiler
7575
<whatsnew315-sampling-profiler>`
76+
* :pep:`831`: :ref:`Frame pointers are enabled by default for improved
77+
system-level observability <whatsnew315-pep831>`
7678
* :pep:`798`: :ref:`Unpacking in Comprehensions
7779
<whatsnew315-unpacking-in-comprehensions>`
7880
* :pep:`686`: :ref:`Python now uses UTF-8 as the default encoding
@@ -324,6 +326,39 @@ available output formats, profiling modes, and configuration options.
324326
(Contributed by Pablo Galindo and László Kiss Kollár in :gh:`135953` and :gh:`138122`.)
325327

326328

329+
.. _whatsnew315-pep831:
330+
331+
:pep:`831`: Frame pointers enabled by default
332+
---------------------------------------------
333+
334+
CPython is now built with frame pointers by default on platforms that support
335+
them. This uses the compiler flags ``-fno-omit-frame-pointer`` and
336+
``-mno-omit-leaf-frame-pointer``, making native stack unwinding faster and
337+
more reliable for system profilers, debuggers, crash analysis tools, and
338+
eBPF-based observability tools.
339+
340+
The flags are exposed through :mod:`sysconfig`, so extension modules built by
341+
tools that consume Python's build configuration inherit frame pointers by
342+
default. This propagation is intentional: mixed Python/native profiling needs
343+
an unbroken frame-pointer chain through the interpreter, extension modules,
344+
embedding applications, and native libraries.
345+
346+
.. important::
347+
348+
Third-party build backends and native build systems should preserve these
349+
flags when they consume Python's :mod:`sysconfig` values. Build systems
350+
that compile C, C++, Rust, or other native code without inheriting Python's
351+
compiler flags should enable equivalent frame-pointer flags themselves. A
352+
single native component built without frame pointers can break stack
353+
unwinding for the whole Python process.
354+
355+
.. seealso:: :pep:`831` for further details.
356+
357+
(Contributed by Pablo Galindo Salgado and Savannah Ostrowski in
358+
:gh:`149201`; PEP 831 written by Pablo Galindo Salgado, Ken Jin, and
359+
Savannah Ostrowski.)
360+
361+
327362
.. _whatsnew315-unpacking-in-comprehensions:
328363

329364
:pep:`798`: Unpacking in Comprehensions

0 commit comments

Comments
 (0)