Skip to content

Commit 394f835

Browse files
committed
Merge in the main branch
2 parents e88843c + 481d5b5 commit 394f835

File tree

254 files changed

+5481
-1724
lines changed

Some content is hidden

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

254 files changed

+5481
-1724
lines changed

.github/CODEOWNERS

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
.github/** @ezio-melotti @hugovk @AA-Turner
99

1010
# pre-commit
11-
.pre-commit-config.yaml @hugovk @AlexWaygood
11+
.pre-commit-config.yaml @hugovk
1212
.ruff.toml @hugovk @AlexWaygood @AA-Turner
1313

1414
# Build system

.github/CONTRIBUTING.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ Contributing to Python
44
Build Status
55
------------
66

7-
- `Buildbot status overview <https://buildbot.python.org/all/#/release_status>`_
7+
- `Buildbot status overview <https://buildbot.python.org/#/release_status>`_
88

99
- `GitHub Actions status <https://github.com/python/cpython/actions/workflows/build.yml>`_
1010

.github/workflows/jit.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,10 @@ jobs:
117117
find /usr/local/bin -lname '*/Library/Frameworks/Python.framework/*' -delete
118118
brew install llvm@${{ matrix.llvm }}
119119
export SDKROOT="$(xcrun --show-sdk-path)"
120+
# Set MACOSX_DEPLOYMENT_TARGET and -Werror=unguarded-availability to
121+
# make sure we don't break downstream distributors (like uv):
122+
export CFLAGS_JIT='-Werror=unguarded-availability'
123+
export MACOSX_DEPLOYMENT_TARGET=10.15
120124
./configure --enable-experimental-jit --enable-universalsdk --with-universal-archs=universal2 ${{ matrix.debug && '--with-pydebug' || '' }}
121125
make all --jobs 4
122126
./python.exe -m test --multiprocess 0 --timeout 4500 --verbose2 --verbose3

Android/android.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,7 @@ def unpack_deps(host, prefix_dir):
187187
os.chdir(prefix_dir)
188188
deps_url = "https://github.com/beeware/cpython-android-source-deps/releases/download"
189189
for name_ver in ["bzip2-1.0.8-3", "libffi-3.4.4-3", "openssl-3.0.15-4",
190-
"sqlite-3.49.1-0", "xz-5.4.6-1", "zstd-1.5.7-1"]:
190+
"sqlite-3.50.4-0", "xz-5.4.6-1", "zstd-1.5.7-1"]:
191191
filename = f"{name_ver}-{host}.tar.gz"
192192
download(f"{deps_url}/{name_ver}/{filename}")
193193
shutil.unpack_archive(filename)

Doc/c-api/complex.rst

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,24 +43,36 @@ pointers. This is consistent throughout the API.
4343
Return the sum of two complex numbers, using the C :c:type:`Py_complex`
4444
representation.
4545
46+
.. deprecated:: 3.15
47+
This function is :term:`soft deprecated`.
48+
4649
4750
.. c:function:: Py_complex _Py_c_diff(Py_complex left, Py_complex right)
4851
4952
Return the difference between two complex numbers, using the C
5053
:c:type:`Py_complex` representation.
5154
55+
.. deprecated:: 3.15
56+
This function is :term:`soft deprecated`.
57+
5258
5359
.. c:function:: Py_complex _Py_c_neg(Py_complex num)
5460
5561
Return the negation of the complex number *num*, using the C
5662
:c:type:`Py_complex` representation.
5763
64+
.. deprecated:: 3.15
65+
This function is :term:`soft deprecated`.
66+
5867
5968
.. c:function:: Py_complex _Py_c_prod(Py_complex left, Py_complex right)
6069
6170
Return the product of two complex numbers, using the C :c:type:`Py_complex`
6271
representation.
6372
73+
.. deprecated:: 3.15
74+
This function is :term:`soft deprecated`.
75+
6476
6577
.. c:function:: Py_complex _Py_c_quot(Py_complex dividend, Py_complex divisor)
6678
@@ -70,6 +82,9 @@ pointers. This is consistent throughout the API.
7082
If *divisor* is null, this method returns zero and sets
7183
:c:data:`errno` to :c:macro:`!EDOM`.
7284
85+
.. deprecated:: 3.15
86+
This function is :term:`soft deprecated`.
87+
7388
7489
.. c:function:: Py_complex _Py_c_pow(Py_complex num, Py_complex exp)
7590
@@ -81,6 +96,19 @@ pointers. This is consistent throughout the API.
8196
8297
Set :c:data:`errno` to :c:macro:`!ERANGE` on overflows.
8398
99+
.. deprecated:: 3.15
100+
This function is :term:`soft deprecated`.
101+
102+
103+
.. c:function:: double _Py_c_abs(Py_complex num)
104+
105+
Return the absolute value of the complex number *num*.
106+
107+
Set :c:data:`errno` to :c:macro:`!ERANGE` on overflows.
108+
109+
.. deprecated:: 3.15
110+
This function is :term:`soft deprecated`.
111+
84112
85113
Complex Numbers as Python Objects
86114
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

Doc/c-api/long.rst

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -372,6 +372,10 @@ distinguished from a number. Use :c:func:`PyErr_Occurred` to disambiguate.
372372
Set *\*value* to a signed C :c:expr:`int32_t` or :c:expr:`int64_t`
373373
representation of *obj*.
374374
375+
If *obj* is not an instance of :c:type:`PyLongObject`, first call its
376+
:meth:`~object.__index__` method (if present) to convert it to a
377+
:c:type:`PyLongObject`.
378+
375379
If the *obj* value is out of range, raise an :exc:`OverflowError`.
376380
377381
Set *\*value* and return ``0`` on success.

Doc/c-api/object.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,7 @@ Object Protocol
197197
in favour of using :c:func:`PyObject_DelAttr`, but there are currently no
198198
plans to remove it.
199199
200-
The function must not be called with ``NULL`` *v* and an an exception set.
200+
The function must not be called with a ``NULL`` *v* and an exception set.
201201
This case can arise from forgetting ``NULL`` checks and would delete the
202202
attribute.
203203
@@ -214,7 +214,7 @@ Object Protocol
214214
If *v* is ``NULL``, the attribute is deleted, but this feature is
215215
deprecated in favour of using :c:func:`PyObject_DelAttrString`.
216216
217-
The function must not be called with ``NULL`` *v* and an an exception set.
217+
The function must not be called with a ``NULL`` *v* and an exception set.
218218
This case can arise from forgetting ``NULL`` checks and would delete the
219219
attribute.
220220

Doc/conf.py

Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -567,14 +567,11 @@
567567
'image': '_static/og-image.png',
568568
'line_color': '#3776ab',
569569
}
570-
if 'builder_html' in tags: # noqa: F821
571-
ogp_custom_meta_tags = [
572-
'<meta name="theme-color" content="#3776ab">',
573-
]
574-
if 'create-social-cards' not in tags: # noqa: F821
575-
# Define a static preview image when not creating social cards
576-
ogp_image = '_static/og-image.png'
577-
ogp_custom_meta_tags += [
578-
'<meta property="og:image:width" content="200">',
579-
'<meta property="og:image:height" content="200">',
580-
]
570+
ogp_custom_meta_tags = ('<meta name="theme-color" content="#3776ab">',)
571+
if 'create-social-cards' not in tags: # noqa: F821
572+
# Define a static preview image when not creating social cards
573+
ogp_image = '_static/og-image.png'
574+
ogp_custom_meta_tags += (
575+
'<meta property="og:image:width" content="200">',
576+
'<meta property="og:image:height" content="200">',
577+
)

Doc/extending/extending.rst

Lines changed: 31 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -75,12 +75,37 @@ the module and a copyright notice if you like).
7575
See :ref:`arg-parsing-string-and-buffers` for a description of this macro.
7676

7777
All user-visible symbols defined by :file:`Python.h` have a prefix of ``Py`` or
78-
``PY``, except those defined in standard header files. For convenience, and
79-
since they are used extensively by the Python interpreter, ``"Python.h"``
80-
includes a few standard header files: ``<stdio.h>``, ``<string.h>``,
81-
``<errno.h>``, and ``<stdlib.h>``. If the latter header file does not exist on
82-
your system, it declares the functions :c:func:`malloc`, :c:func:`free` and
83-
:c:func:`realloc` directly.
78+
``PY``, except those defined in standard header files.
79+
80+
.. tip::
81+
82+
For backward compatibility, :file:`Python.h` includes several standard header files.
83+
C extensions should include the standard headers that they use,
84+
and should not rely on these implicit includes.
85+
If using the limited C API version 3.13 or newer, the implicit includes are:
86+
87+
* ``<assert.h>``
88+
* ``<intrin.h>`` (on Windows)
89+
* ``<inttypes.h>``
90+
* ``<limits.h>``
91+
* ``<math.h>``
92+
* ``<stdarg.h>``
93+
* ``<wchar.h>``
94+
* ``<sys/types.h>`` (if present)
95+
96+
If :c:macro:`Py_LIMITED_API` is not defined, or is set to version 3.12 or older,
97+
the headers below are also included:
98+
99+
* ``<ctype.h>``
100+
* ``<unistd.h>`` (on POSIX)
101+
102+
If :c:macro:`Py_LIMITED_API` is not defined, or is set to version 3.10 or older,
103+
the headers below are also included:
104+
105+
* ``<errno.h>``
106+
* ``<stdio.h>``
107+
* ``<stdlib.h>``
108+
* ``<string.h>``
84109

85110
The next thing we add to our module file is the C function that will be called
86111
when the Python expression ``spam.system(string)`` is evaluated (we'll see

Doc/glossary.rst

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -435,6 +435,11 @@ Glossary
435435
with :term:`abstract base classes <abstract base class>`.) Instead, it
436436
typically employs :func:`hasattr` tests or :term:`EAFP` programming.
437437

438+
dunder
439+
An informal short-hand for "double underscore", used when talking about a
440+
:term:`special method`. For example, ``__init__`` is often pronounced
441+
"dunder init".
442+
438443
EAFP
439444
Easier to ask for forgiveness than permission. This common Python coding
440445
style assumes the existence of valid keys or attributes and catches
@@ -462,6 +467,7 @@ Glossary
462467
core and with user code.
463468

464469
f-string
470+
f-strings
465471
String literals prefixed with ``f`` or ``F`` are commonly called
466472
"f-strings" which is short for
467473
:ref:`formatted string literals <f-strings>`. See also :pep:`498`.
@@ -1323,6 +1329,7 @@ Glossary
13231329
See also :term:`borrowed reference`.
13241330

13251331
t-string
1332+
t-strings
13261333
String literals prefixed with ``t`` or ``T`` are commonly called
13271334
"t-strings" which is short for
13281335
:ref:`template string literals <t-strings>`.
@@ -1472,6 +1479,11 @@ Glossary
14721479
A computer defined entirely in software. Python's virtual machine
14731480
executes the :term:`bytecode` emitted by the bytecode compiler.
14741481

1482+
walrus operator
1483+
A light-hearted way to refer to the :ref:`assignment expression
1484+
<assignment-expressions>` operator ``:=`` because it looks a bit like a
1485+
walrus if you turn your head.
1486+
14751487
Zen of Python
14761488
Listing of Python design principles and philosophies that are helpful in
14771489
understanding and using the language. The listing can be found by typing

0 commit comments

Comments
 (0)