Skip to content

Commit 5695235

Browse files
authored
Merge branch 'main' into patch-2
2 parents 8bd7850 + 781e8d8 commit 5695235

7 files changed

Lines changed: 107 additions & 21 deletions

File tree

‎.github/CODEOWNERS‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,4 @@
55
# https://git-scm.com/docs/gitignore#_pattern_format
66

77
# PSRT member list owned by PSRT admins.
8-
security/psrt*.csv @warsaw @ewdurbin @ned-deily @sethmlarson @stanfromireland
8+
security/psrt*.csv @warsaw @JacobCoffee @ned-deily @sethmlarson @stanfromireland

‎core-team/experts.rst‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,7 @@ contextlib ncoghlan, 1st1
6767
copy serhiy-storchaka*
6868
copyreg serhiy-storchaka*
6969
csv serhiy-storchaka*
70+
ctypes ZeroIntensity*
7071
curses Yhg1s
7172
dataclasses ericvsmith*, carljm
7273
datetime pganssle, StanFromIreland

‎development-tools/clinic/howto.rst‎

Lines changed: 91 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1617,3 +1617,94 @@ and update your unit tests to reflect the new behaviour.
16171617
If you forget to update your input block during the alpha and beta phases,
16181618
the compiler warning will turn into a compiler error when the
16191619
release candidate phase begins.
1620+
1621+
1622+
.. _clinic-howto-remove-parameter:
1623+
1624+
How to remove a parameter
1625+
-------------------------
1626+
1627+
A parameter cannot be removed right away:
1628+
as mandated by Python's backwards-compatibility policy (see :pep:`387`),
1629+
passing it must first emit a :exc:`DeprecationWarning` for two releases.
1630+
The ``[until ...]`` prefix marks a parameter which is going away and names
1631+
the release in which it will be removed::
1632+
1633+
/*[clinic input]
1634+
module foo
1635+
myfunc
1636+
a: object
1637+
[until 3.18] b: object = None
1638+
* [from 3.18]
1639+
c: object = None
1640+
[clinic start generated code]*/
1641+
1642+
Passing an argument for *b* now emits:
1643+
1644+
.. code-block:: none
1645+
1646+
DeprecationWarning: Passing the argument 'b' to myfunc() is deprecated. It will be removed in Python 3.18.
1647+
1648+
A deprecated parameter must have a default value, because calls which do not
1649+
pass it must already be valid.
1650+
1651+
Removing a parameter shifts the position of every parameter which follows it,
1652+
so they should become keyword-only in the same release,
1653+
using the ``* [from ...]`` syntax described above.
1654+
This is why *c* is deprecated as a positional parameter in the example above.
1655+
Argument Clinic enforces this for positional-only parameters:
1656+
only the last of them can be deprecated, because there is no way to pass
1657+
a positional-only parameter which follows a removed one.
1658+
1659+
As with the ``[from ...]`` syntax described above, C preprocessor directives
1660+
are generated for emitting compiler warnings if the ``[until ...]`` prefix has
1661+
not been removed from the Argument Clinic input when the deprecation period is
1662+
over.
1663+
Then remove the parameter and the corresponding argument of the "impl"
1664+
function.
1665+
1666+
.. versionadded:: 3.16
1667+
1668+
1669+
.. _clinic-howto-rename-parameter:
1670+
1671+
How to rename a parameter
1672+
-------------------------
1673+
1674+
Renaming a positional-only parameter is backward compatible:
1675+
its name cannot be used in a call, so it is enough to change it.
1676+
1677+
For a positional-or-keyword or a keyword-only parameter the name is a part of
1678+
the API, so the old name can only be removed after a deprecation period.
1679+
Change the name of the parameter, and add an optional keyword-only parameter
1680+
with the old name, the C name of the renamed parameter and the ``[until ...]``
1681+
prefix::
1682+
1683+
/*[clinic input]
1684+
module foo
1685+
myfunc
1686+
source: object = None
1687+
flag: bool = False
1688+
*
1689+
[until 3.18] input as source: object = None
1690+
[clinic start generated code]*/
1691+
1692+
A parameter which shares the C variable of a preceding parameter is an
1693+
alternative name (an *alias*) of it:
1694+
both names fill the same argument of the "impl" function, and only one of them
1695+
can be used in a call, so ``myfunc(1, input=2)`` and
1696+
``myfunc(source=1, input=2)`` raise :exc:`TypeError`.
1697+
An alias is declared after all other parameters, but it fills the slot of
1698+
the parameter which it renames, so ``myfunc(input=1, flag=True)`` works.
1699+
It is not shown in the signature, which for the function above is
1700+
``($module, /, source=None, flag=False)``.
1701+
1702+
Passing an argument for the old name now emits:
1703+
1704+
.. code-block:: none
1705+
1706+
DeprecationWarning: Passing the argument 'input' to myfunc() is deprecated. Use 'source' instead. It will be removed in Python 3.18.
1707+
1708+
When the deprecation period is over, remove the alias.
1709+
1710+
.. versionadded:: 3.16

‎documentation/translations/coordinating.rst‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ Once the following resources have been fully translated:
142142

143143
- ``bugs.po``, with proper links to the language repository issue tracker
144144
- all files in the ``tutorial/`` folder
145-
- ``library/functions.po``, the page documenting builtins
145+
- ``builtins/functions.po``
146146

147147
the translation can be added to the language switcher. This can be done with a
148148
pull request to docsbuild-scripts_, like `this commit <https://github.com/python/docsbuild-scripts/commit/e4a8aff9772738a63d0945042777d18c3d926930>`__
@@ -167,7 +167,7 @@ Here are the essential points of :PEP:`545`:
167167
``https://github.com/python/python-docs-{LANGUAGE_TAG}``
168168

169169
- Translations having completed ``bugs``, ``tutorial/``
170-
and ``library/functions`` are added to the language switcher.
170+
and ``builtins/functions`` are added to the language switcher.
171171

172172

173173
Translating Sphinx

‎getting-started/setup-building.rst‎

Lines changed: 8 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -841,8 +841,11 @@ some of CPython's modules (for example, ``zlib``).
841841
inetutils-inetd
842842

843843
Note that Debian 12 and Ubuntu 24.04 do not have the ``libmpdec-dev``
844-
package. You can safely remove it from the install list above and the
845-
Python build will use a bundled version. But we recommend using the system
844+
package. You can remove it from the install list above: for Python 3.15
845+
and older, the build will use a bundled version; for Python 3.16 and
846+
newer, the bundled copy has been removed and the :mod:`decimal` module
847+
will fall back to its slower pure-Python implementation. We recommend
848+
using the system
846849
`libmpdec <https://www.bytereef.org/mpdecimal/doc/libmpdec/>`__ library.
847850
Either build it from sources or install this package from
848851
https://deb.sury.org.
@@ -912,25 +915,16 @@ some of CPython's modules (for example, ``zlib``).
912915

913916
$ sudo port install pkgconfig openssl xz gdbm tk +quartz mpdecimal zstd
914917

915-
.. tab:: Python 3.13+
916-
917-
For Python 3.13 and newer::
918-
919-
$ GDBM_CFLAGS="-I$(dirname $(dirname $(which port)))/include" \
920-
GDBM_LIBS="-L$(dirname $(dirname $(which port)))/lib -lgdbm" \
921-
./configure --config-cache \
922-
--with-pydebug \
923-
--with-system-libmpdec
924-
925-
.. tab:: Python 3.11-3.12
918+
.. tab:: Python 3.11+
926919

927-
For Python 3.11 and 3.12::
920+
For Python 3.11 and newer::
928921

929922
$ GDBM_CFLAGS="-I$(dirname $(dirname $(which port)))/include" \
930923
GDBM_LIBS="-L$(dirname $(dirname $(which port)))/lib -lgdbm" \
931924
./configure --config-cache \
932925
--with-pydebug
933926

927+
934928
And finally, run ``make``::
935929

936930
$ make -s -j8

‎security/psrt.csv‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,12 @@ Benjamin Peterson,benjaminp,
55
Damian Shaw,notatallshaw,
66
Donald Stufft,dstufft,
77
Dustin Ingram,di,
8-
Ee Durbin,ewdurbin,Admin
8+
Ee Durbin,ewdurbin,
99
Emma Smith,emmatyping,
1010
Glyph Lefkowitz,glyph,
1111
Gregory P. Smith,gpshead,
1212
Hugo van Kemenade,hugovk,Release Manager
13-
Jacob Coffee,JacobCoffee,
13+
Jacob Coffee,JacobCoffee,Admin
1414
Jelle Zijlstra,JelleZijlstra,
1515
Kushal Das,kushaldas,
1616
Kirill Podoprigora,eclips4,

‎security/sbom.rst‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ that the CPython project uses is `SPDX <https://spdx.github.io/spdx-spec/v2.3/>`
1010
which can be transformed into other formats if necessary by consumers.
1111

1212
There are multiple sources of third-party dependencies for CPython.
13-
Some are vendored into the source code of CPython itself (like ``mpdecimal``
14-
vendored at :cpy-file:`Modules/_decimal/libmpdec`) or they could be optionally pulled
13+
Some are vendored into the source code of CPython itself (like ``expat``
14+
vendored at :cpy-file:`Modules/expat`) or they could be optionally pulled
1515
in during builds like Windows using dependencies from the
1616
`python/cpython-source-deps <https://github.com/python/cpython-source-deps>`__
1717
repository.

0 commit comments

Comments
 (0)