Skip to content

Commit 5131659

Browse files
generatedunixname1734921407115435meta-codesync[bot]
authored andcommitted
Import CPython 3.15.1+dev stable branch (2026-10-24)
Summary: Imported python/cpython `3.15.1+dev` from upstream rev [`e561b19`](https://www.github.com/python/cpython/commit/e561b199e8b43d9734df130c0af99752ae4449bb) (committed 2026-10-24 03:33:11+00:00). # Commit Info - Base: (`3.15.1+dev`) - [`45f5b00`](https://www.github.com/python/cpython/commit/45f5b00a9a6e9921ef74cd9ef28acb5b86cafa73) (commit date: 2026-10-23 01:33:45+00:00) - Imported: (`3.15.1+dev`) - [`e561b19`](https://www.github.com/python/cpython/commit/e561b199e8b43d9734df130c0af99752ae4449bb) (commit date: 2026-10-24 03:33:11+00:00) # Noteworthy file changes - Low-signal files (13 added) (NEWS.d, docs, .github) Complete list of added/removed files: https://www.internalfb.com/intern/everpaste/?color=0&handle=GLFWxzLisT4kWIwMAFoRnBSoTLNmbr0LAAAz Reviewed By: itamaro Differential Revision: D127315796 fbshipit-source-id: 63db139180a1fb9e215c05146413289eee58910c
1 parent 519dca2 commit 5131659

66 files changed

Lines changed: 1230 additions & 436 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎Doc/builtins/functions.rst‎

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -314,6 +314,10 @@ are always available. They are listed here in alphabetical order.
314314
consists of a single expression, or ``'single'`` if it consists of a single
315315
interactive statement (in the latter case, expression statements that
316316
evaluate to something other than ``None`` will be printed).
317+
It can also be ``'func_type'`` if *source* consists of a
318+
function type signature, for example ``(int) -> str``; see
319+
:func:`ast.parse` for more information. This mode requires passing
320+
:data:`ast.PyCF_ONLY_AST` in *flags*.
317321

318322
The optional arguments *flags* and *dont_inherit* control which
319323
:ref:`compiler options <ast-compiler-flags>` should be activated
@@ -387,6 +391,9 @@ are always available. They are listed here in alphabetical order.
387391
``ast.PyCF_ALLOW_TOP_LEVEL_AWAIT`` can now be passed in flags to enable
388392
support for top-level ``await``, ``async for``, and ``async with``.
389393

394+
.. versionchanged:: 3.8
395+
Added support for ``mode='func_type'``.
396+
390397
.. versionchanged:: 3.12
391398
:exc:`SyntaxError` is raised instead of :exc:`ValueError` when null bytes
392399
are encountered in *source*.

‎Doc/c-api/code.rst‎

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -94,11 +94,12 @@ bound into a function.
9494
9595
.. c:function:: int PyCode_Addr2Line(PyCodeObject *co, int byte_offset)
9696
97-
Return the line number of the instruction that occurs on or before ``byte_offset`` and ends after it.
98-
If you just need the line number of a frame, use :c:func:`PyFrame_GetLineNumber` instead.
97+
Return the line number of the instruction that occurs on or before
98+
``byte_offset`` and ends after it. This may be ``O(N)`` in the number of
99+
instructions in the code object, so it is not performant for iterating over
100+
all the line numbers in a code object.
99101
100-
For efficiently iterating over the line numbers in a code object, use :pep:`the API described in PEP 626
101-
<0626#out-of-process-debuggers-and-profilers>`.
102+
If you just need the line number of a frame, use :c:func:`PyFrame_GetLineNumber` instead.
102103
103104
.. c:function:: int PyCode_Addr2Location(PyObject *co, int byte_offset, int *start_line, int *start_column, int *end_line, int *end_column)
104105

0 commit comments

Comments
 (0)