Skip to content

Commit 1f7b4aa

Browse files
authored
Merge branch '3.14' into fips-property
2 parents 4662732 + e35d340 commit 1f7b4aa

202 files changed

Lines changed: 3510 additions & 662 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.

‎.github/workflows/reusable-macos.yml‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ jobs:
5353
--enable-slower-safety \
5454
--enable-safety \
5555
${{ inputs.free-threading && '--disable-gil' || '' }} \
56+
--with-tail-call-interp \
5657
--prefix=/opt/python-dev \
5758
--with-openssl="$(brew --prefix openssl@3.0)"
5859
- name: Build CPython

‎.github/workflows/tail-call.yml‎

Lines changed: 0 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -57,31 +57,6 @@ jobs:
5757
run: |
5858
./PCbuild/rt.bat -p ${{ matrix.architecture }} -q --multiprocess 0 --timeout 4500 --verbose2 --verbose3
5959
60-
macos:
61-
name: aarch64-apple-darwin/clang
62-
runs-on: macos-26
63-
timeout-minutes: 60
64-
steps:
65-
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
66-
with:
67-
persist-credentials: false
68-
- uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7.0.0
69-
with:
70-
python-version: '3.11'
71-
- name: Install dependencies
72-
run: |
73-
brew update
74-
brew install llvm@${{ env.LLVM_VERSION }}
75-
- name: Build
76-
run: |
77-
export SDKROOT="$(xcrun --show-sdk-path)"
78-
export PATH="/opt/homebrew/opt/llvm@${{ env.LLVM_VERSION }}/bin:$PATH"
79-
CC=clang-${{ env.LLVM_VERSION }} ./configure --with-tail-call-interp
80-
make all --jobs 4
81-
- name: Test
82-
run: |
83-
./python.exe -m test --multiprocess 0 --timeout 4500 --verbose2 --verbose3
84-
8560
linux:
8661
name: ${{ matrix.target }}
8762
runs-on: ${{ matrix.runner }}

‎Doc/builtins/exceptions.rst‎

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -388,10 +388,9 @@ The following exceptions are the exceptions that are usually raised.
388388

389389
.. attribute:: strerror
390390

391-
The corresponding error message, as provided by
392-
the operating system. It is formatted by the C
393-
functions :c:func:`!perror` under POSIX, and :c:func:`!FormatMessage`
394-
under Windows.
391+
The corresponding error message, as provided by the operating system.
392+
Under POSIX, it is obtained using the C functions :c:func:`!strerror`
393+
or :c:func:`!strerror_r`; under Windows, :c:func:`!FormatMessage` is used.
395394

396395
.. attribute:: filename
397396
filename2
@@ -552,11 +551,6 @@ The following exceptions are the exceptions that are usually raised.
552551
The column in the end line where the error occurred finishes. This is
553552
1-indexed: the first character in the line has an ``offset`` of 1.
554553

555-
For errors in f-string fields, the message is prefixed by "f-string: "
556-
and the offsets are offsets in a text constructed from the replacement
557-
expression. For example, compiling f'Bad {a b} field' results in this
558-
args attribute: ('f-string: ...', ('', 1, 2, '(a b)\n', 1, 5)).
559-
560554
.. versionchanged:: 3.10
561555
Added the :attr:`end_lineno` and :attr:`end_offset` attributes.
562556

‎Doc/builtins/functions.rst‎

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -717,7 +717,7 @@ are always available. They are listed here in alphabetical order.
717717
still access all builtins.
718718

719719
The *closure* argument specifies a closure--a tuple of cellvars.
720-
It's only valid when the *object* is a code object containing
720+
It's only valid when *source* is a code object containing
721721
:term:`free (closure) variables <closure variable>`.
722722
The length of the tuple must exactly match the length of the code object's
723723
:attr:`~codeobject.co_freevars` attribute.
@@ -2025,10 +2025,10 @@ are always available. They are listed here in alphabetical order.
20252025

20262026
When called directly within an ordinary method of a class, both arguments may
20272027
be omitted ("zero-argument :func:`!super`"). In this case, *type* will be the
2028-
enclosing class, and *obj* will be the first argument of the immediately
2029-
enclosing function (typically ``self``). (This means that zero-argument
2028+
enclosing class, and *object_or_type* will be the first argument of the
2029+
immediately enclosing function (typically ``self``). Zero-argument
20302030
:func:`!super` will not work as expected within nested functions, including
2031-
generator expressions, which implicitly create nested functions.)
2031+
generator expressions, which implicitly create nested functions.
20322032

20332033
There are two typical use cases for *super*. In a class hierarchy with
20342034
single inheritance, *super* can be used to refer to parent classes without
@@ -2283,10 +2283,9 @@ are always available. They are listed here in alphabetical order.
22832283
determine the package context of the :keyword:`import` statement.
22842284

22852285
*level* specifies whether to use absolute or relative imports. ``0`` (the
2286-
default) means only perform absolute imports. Positive values for
2287-
*level* indicate the number of parent directories to search relative to the
2288-
directory of the module calling :func:`__import__` (see :pep:`328` for the
2289-
details).
2286+
default) means only perform absolute imports. For relative imports,
2287+
``1`` refers to the current package, ``2`` to its parent package, and so on
2288+
(see :pep:`328` for details).
22902289

22912290
When the *name* variable is of the form ``package.module``, normally, the
22922291
top-level package (the name up till the first dot) is returned, *not* the

‎Doc/builtins/stdtypes.rst‎

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1858,13 +1858,23 @@ expression support in the :mod:`re` module).
18581858
.. method:: str.capitalize()
18591859

18601860
Return a copy of the string with its first character capitalized and the
1861-
rest lowercased.
1861+
rest lowercased. For example:
1862+
1863+
.. doctest::
1864+
1865+
>>> 'PYTHON IS AMAZING'.capitalize()
1866+
'Python is amazing'
1867+
>>> 'Njemačka starts With a non-ASCII digraph'.capitalize()
1868+
'Njemačka starts with a non-ascii digraph'
1869+
1870+
See also :meth:`title`.
18621871

18631872
.. versionchanged:: 3.8
18641873
The first character is now put into titlecase rather than uppercase.
18651874
This means that characters like digraphs will only have their first
18661875
letter capitalized, instead of the full character.
18671876

1877+
18681878
.. method:: str.casefold()
18691879

18701880
Return a casefolded copy of the string. Casefolded strings may be used for
@@ -2862,7 +2872,7 @@ expression support in the :mod:`re` module).
28622872
>>> titlecase("they're bill's friends.")
28632873
"They're Bill's Friends."
28642874

2865-
See also :meth:`istitle`.
2875+
See also :meth:`istitle` and :meth:`capitalize`.
28662876

28672877

28682878
.. method:: str.translate(table, /)
@@ -5332,7 +5342,7 @@ can be used interchangeably to index the same dictionary entry.
53325342

53335343
* Use a comma-separated list of ``key: value`` pairs within braces:
53345344
``{'jack': 4098, 'sjoerd': 4127}`` or ``{4098: 'jack', 4127: 'sjoerd'}``
5335-
* Use a dict comprehension: ``{}``, ``{x: x ** 2 for x in range(10)}``
5345+
* Use a dict comprehension: ``{x: x ** 2 for x in range(10)}``
53365346
* Use the type constructor: ``dict()``,
53375347
``dict([('foo', 100), ('bar', 200)])``, ``dict(foo=100, bar=200)``
53385348

@@ -5543,9 +5553,8 @@ can be used interchangeably to index the same dictionary entry.
55435553
Return a new view of the dictionary's values. See the
55445554
:ref:`documentation of view objects <dict-views>`.
55455555

5546-
An equality comparison between one ``dict.values()`` view and another
5547-
will always return ``False``. This also applies when comparing
5548-
``dict.values()`` to itself::
5556+
An equality comparison between two distinct ``dict.values()`` views
5557+
will always return ``False``, even for views of the same dictionary::
55495558

55505559
>>> d = {'a': 1}
55515560
>>> d.values() == d.values()

‎Doc/c-api/frame.rst‎

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -99,8 +99,6 @@ See also :ref:`Reflection <reflection>`.
9999
100100
Get the *frame*'s :attr:`~frame.f_lasti` attribute.
101101
102-
Returns -1 if ``frame.f_lasti`` is ``None``.
103-
104102
.. versionadded:: 3.11
105103
106104

‎Doc/c-api/gcsupport.rst‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ rules:
4242
.. warning::
4343
If a type adds the Py_TPFLAGS_HAVE_GC, then it *must* implement at least
4444
a :c:member:`~PyTypeObject.tp_traverse` handler or explicitly use one
45-
from its subclass or subclasses.
45+
from a base class.
4646

4747
When calling :c:func:`PyType_Ready` or some of the APIs that indirectly
4848
call it like :c:func:`PyType_FromSpecWithBases` or

‎Doc/c-api/gen.rst‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ Generator Objects
66
-----------------
77

88
Generator objects are what Python uses to implement generator iterators. They
9-
are normally created by iterating over a function that yields values, rather
10-
than explicitly calling :c:func:`PyGen_New` or :c:func:`PyGen_NewWithQualName`.
9+
are normally created by calling a generator function, rather than explicitly
10+
calling :c:func:`PyGen_New` or :c:func:`PyGen_NewWithQualName`.
1111

1212

1313
.. c:type:: PyGenObject

‎Doc/c-api/init_config.rst‎

Lines changed: 27 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -156,8 +156,10 @@ UTF-8 encoded string. See :ref:`Configuration Options <pyinitconfig-opts>`.
156156
* Set *\*value*, and return ``0`` on success.
157157
* Set an error in *config* and return ``-1`` on error.
158158
159-
*\*value* can be set to ``NULL`` if the option is an optional string and the
160-
option is unset.
159+
*\*value* can be set to ``NULL`` if the option is unset or if the option is
160+
an optional string.
161+
Optional strings are documented with the type ``str | None`` in the
162+
:ref:`Configuration Options <pyinitconfig-opts>` table.
161163
162164
On success, the string must be released with ``free(value)`` if it's not
163165
``NULL``.
@@ -168,7 +170,7 @@ UTF-8 encoded string. See :ref:`Configuration Options <pyinitconfig-opts>`.
168170
Get a string list configuration option as an array of
169171
null-terminated UTF-8 encoded strings.
170172
171-
* Set *\*length* and *\*value*, and return ``0`` on success.
173+
* Set *\*length* and *\*items*, and return ``0`` on success.
172174
* Set an error in *config* and return ``-1`` on error.
173175
174176
On success, the string list must be released with
@@ -205,6 +207,9 @@ only implemented when ``Py_InitializeFromInitConfig()`` is called, not by the
205207
Set a string configuration option from a null-terminated UTF-8
206208
encoded string. The string is copied.
207209
210+
Options documented with the type ``str | None`` in the :ref:`Configuration
211+
Options <pyinitconfig-opts>` table can be set to ``NULL``.
212+
208213
* Return ``0`` on success.
209214
* Set an error in *config* and return ``-1`` on error.
210215
@@ -275,15 +280,15 @@ Configuration Options
275280
- Public
276281
* - ``"base_exec_prefix"``
277282
- :c:member:`base_exec_prefix <PyConfig.base_exec_prefix>`
278-
- ``str``
283+
- ``str | None``
279284
- Public
280285
* - ``"base_executable"``
281286
- :c:member:`base_executable <PyConfig.base_executable>`
282-
- ``str``
287+
- ``str | None``
283288
- Public
284289
* - ``"base_prefix"``
285290
- :c:member:`base_prefix <PyConfig.base_prefix>`
286-
- ``str``
291+
- ``str | None``
287292
- Public
288293
* - ``"buffered_stdio"``
289294
- :c:member:`buffered_stdio <PyConfig.buffered_stdio>`
@@ -331,15 +336,15 @@ Configuration Options
331336
- Read-only
332337
* - ``"dump_refs_file"``
333338
- :c:member:`dump_refs_file <PyConfig.dump_refs_file>`
334-
- ``str``
339+
- ``str | None``
335340
- Read-only
336341
* - ``"exec_prefix"``
337342
- :c:member:`exec_prefix <PyConfig.exec_prefix>`
338-
- ``str``
343+
- ``str | None``
339344
- Public
340345
* - ``"executable"``
341346
- :c:member:`executable <PyConfig.executable>`
342-
- ``str``
347+
- ``str | None``
343348
- Public
344349
* - ``"faulthandler"``
345350
- :c:member:`faulthandler <PyConfig.faulthandler>`
@@ -359,7 +364,7 @@ Configuration Options
359364
- Read-only
360365
* - ``"home"``
361366
- :c:member:`home <PyConfig.home>`
362-
- ``str``
367+
- ``str | None``
363368
- Read-only
364369
* - ``"import_time"``
365370
- :c:member:`import_time <PyConfig.import_time>`
@@ -431,35 +436,35 @@ Configuration Options
431436
- Public
432437
* - ``"prefix"``
433438
- :c:member:`prefix <PyConfig.prefix>`
434-
- ``str``
439+
- ``str | None``
435440
- Public
436441
* - ``"program_name"``
437442
- :c:member:`program_name <PyConfig.program_name>`
438443
- ``str``
439444
- Read-only
440445
* - ``"pycache_prefix"``
441446
- :c:member:`pycache_prefix <PyConfig.pycache_prefix>`
442-
- ``str``
447+
- ``str | None``
443448
- Public
444449
* - ``"quiet"``
445450
- :c:member:`quiet <PyConfig.quiet>`
446451
- ``bool``
447452
- Public
448453
* - ``"run_command"``
449454
- :c:member:`run_command <PyConfig.run_command>`
450-
- ``str``
455+
- ``str | None``
451456
- Read-only
452457
* - ``"run_filename"``
453458
- :c:member:`run_filename <PyConfig.run_filename>`
454-
- ``str``
459+
- ``str | None``
455460
- Read-only
456461
* - ``"run_module"``
457462
- :c:member:`run_module <PyConfig.run_module>`
458-
- ``str``
463+
- ``str | None``
459464
- Read-only
460465
* - ``"run_presite"``
461466
- :c:member:`run_presite <PyConfig.run_presite>`
462-
- ``str``
467+
- ``str | None``
463468
- Read-only
464469
* - ``"safe_path"``
465470
- :c:member:`safe_path <PyConfig.safe_path>`
@@ -479,15 +484,15 @@ Configuration Options
479484
- Read-only
480485
* - ``"stdio_encoding"``
481486
- :c:member:`stdio_encoding <PyConfig.stdio_encoding>`
482-
- ``str``
487+
- ``str | None``
483488
- Read-only
484489
* - ``"stdio_errors"``
485490
- :c:member:`stdio_errors <PyConfig.stdio_errors>`
486491
- ``str``
487492
- Read-only
488493
* - ``"stdlib_dir"``
489494
- :c:member:`stdlib_dir <PyConfig.stdlib_dir>`
490-
- ``str``
495+
- ``str | None``
491496
- Public
492497
* - ``"tracemalloc"``
493498
- :c:member:`tracemalloc <PyConfig.tracemalloc>`
@@ -542,6 +547,9 @@ Configuration Options
542547
- ``bool``
543548
- Read-only
544549
550+
The type ``str | None`` means that the option is an optional string which can
551+
be set to ``NULL``.
552+
545553
Visibility:
546554
547555
* Public: Can be retrieved by :c:func:`PyConfig_Get` and set by
@@ -1936,7 +1944,7 @@ PyConfig
19361944
If equals to zero, ignore the :ref:`environment variables
19371945
<using-on-envvars>`.
19381946
1939-
Set to ``0`` by the :option:`-E` environment variable.
1947+
Set to ``0`` by the :option:`-E` command-line option.
19401948
19411949
Default: ``1`` in Python config and ``0`` in isolated config.
19421950

‎Doc/c-api/interp-lifecycle.rst‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -839,9 +839,9 @@ Process-wide parameters
839839
formed from the "official" name of the operating system, converted to lower
840840
case, followed by the major revision number; e.g., for Solaris 2.x, which is
841841
also known as SunOS 5.x, the value is ``'sunos5'``. On macOS, it is
842-
``'darwin'``. On Windows, it is ``'win'``. The returned string points into
843-
static storage; the caller should not modify its value. The value is available
844-
to Python code as ``sys.platform``.
842+
``'darwin'``. On Windows, it is ``'win32'``. The returned string points
843+
into static storage; the caller should not modify its value. The value is
844+
available to Python code as ``sys.platform``.
845845

846846

847847
.. c:function:: const char* Py_GetCopyright()

0 commit comments

Comments
 (0)