Skip to content

Commit 2c67e71

Browse files
authored
Merge branch 'main' into exception-group-repr
2 parents fcaf314 + 8c33c61 commit 2c67e71

File tree

380 files changed

+15111
-5974
lines changed

Some content is hidden

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

380 files changed

+15111
-5974
lines changed

.github/CONTRIBUTING.rst

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -28,13 +28,12 @@ Please be aware that our workflow does deviate slightly from the typical GitHub
2828
project. Details on how to properly submit a pull request are covered in
2929
`Lifecycle of a Pull Request <https://devguide.python.org/getting-started/pull-request-lifecycle.html>`_.
3030
We utilize various bots and status checks to help with this, so do follow the
31-
comments they leave and their "Details" links, respectively. The key points of
32-
our workflow that are not covered by a bot or status check are:
31+
comments they leave and their "Details" links, respectively.
3332

34-
- All discussions that are not directly related to the code in the pull request
35-
should happen on `GitHub Issues <https://github.com/python/cpython/issues>`_.
36-
- Upon your first non-trivial pull request (which includes documentation changes),
37-
feel free to add yourself to ``Misc/ACKS``.
33+
The final key part of our workflow is that all discussions that are not
34+
directly related to the code in the pull request should happen on
35+
`GitHub Issues <https://github.com/python/cpython/issues>`__, generally in the
36+
pull request's parent issue.
3837

3938

4039
Setting Expectations

.github/dependabot.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,17 @@ updates:
1212
update-types:
1313
- "version-update:semver-minor"
1414
- "version-update:semver-patch"
15+
cooldown:
16+
# https://blog.yossarian.net/2025/11/21/We-should-all-be-using-dependency-cooldowns
17+
# Cooldowns protect against supply chain attacks by avoiding the
18+
# highest-risk window immediately after new releases.
19+
default-days: 14
1520
- package-ecosystem: "pip"
1621
directory: "/Tools/"
1722
schedule:
1823
interval: "monthly"
1924
labels:
2025
- "skip issue"
2126
- "skip news"
27+
cooldown:
28+
default-days: 14

.github/workflows/reusable-wasi.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ jobs:
1313
timeout-minutes: 60
1414
env:
1515
WASMTIME_VERSION: 38.0.3
16-
WASI_SDK_VERSION: 25
16+
WASI_SDK_VERSION: 29
1717
WASI_SDK_PATH: /opt/wasi-sdk
1818
CROSS_BUILD_PYTHON: cross-build/build
1919
CROSS_BUILD_WASI: cross-build/wasm32-wasip1

Doc/about.rst

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,9 @@ Contributors to the Python documentation
3232
----------------------------------------
3333

3434
Many people have contributed to the Python language, the Python standard
35-
library, and the Python documentation. See :source:`Misc/ACKS` in the Python
36-
source distribution for a partial list of contributors.
35+
library, and the Python documentation. See the `CPython
36+
GitHub repository <https://github.com/python/cpython/graphs/contributors>`__
37+
for a partial list of contributors.
3738

3839
It is only with the input and contributions of the Python community
3940
that Python has such wonderful documentation -- Thank You!

Doc/c-api/conversion.rst

Lines changed: 23 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -162,16 +162,33 @@ The following functions provide locale-independent string to number conversions.
162162
.. versionadded:: 3.1
163163
164164
165-
.. c:function:: int PyOS_stricmp(const char *s1, const char *s2)
165+
.. c:function:: int PyOS_mystricmp(const char *str1, const char *str2)
166+
int PyOS_mystrnicmp(const char *str1, const char *str2, Py_ssize_t size)
166167
167-
Case insensitive comparison of strings. The function works almost
168-
identically to :c:func:`!strcmp` except that it ignores the case.
168+
Case insensitive comparison of strings. These functions work almost
169+
identically to :c:func:`!strcmp` and :c:func:`!strncmp` (respectively),
170+
except that they ignore the case of ASCII characters.
169171
172+
Return ``0`` if the strings are equal, a negative value if *str1* sorts
173+
lexicographically before *str2*, or a positive value if it sorts after.
170174
171-
.. c:function:: int PyOS_strnicmp(const char *s1, const char *s2, Py_ssize_t size)
175+
In the *str1* or *str2* arguments, a NUL byte marks the end of the string.
176+
For :c:func:`!PyOS_mystrnicmp`, the *size* argument gives the maximum size
177+
of the string, as if NUL was present at the index given by *size*.
172178
173-
Case insensitive comparison of strings. The function works almost
174-
identically to :c:func:`!strncmp` except that it ignores the case.
179+
These functions do not use the locale.
180+
181+
182+
.. c:function:: int PyOS_stricmp(const char *str1, const char *str2)
183+
int PyOS_strnicmp(const char *str1, const char *str2, Py_ssize_t size)
184+
185+
Case insensitive comparison of strings.
186+
187+
On Windows, these are aliases of :c:func:`!stricmp` and :c:func:`!strnicmp`,
188+
respectively.
189+
190+
On other platforms, they are aliases of :c:func:`PyOS_mystricmp` and
191+
:c:func:`PyOS_mystrnicmp`, respectively.
175192
176193
177194
Character classification and conversion

Doc/c-api/datetime.rst

Lines changed: 46 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,42 @@ DateTime Objects
88
Various date and time objects are supplied by the :mod:`datetime` module.
99
Before using any of these functions, the header file :file:`datetime.h` must be
1010
included in your source (note that this is not included by :file:`Python.h`),
11-
and the macro :c:macro:`!PyDateTime_IMPORT` must be invoked, usually as part of
11+
and the macro :c:macro:`PyDateTime_IMPORT` must be invoked, usually as part of
1212
the module initialisation function. The macro puts a pointer to a C structure
13-
into a static variable, :c:data:`!PyDateTimeAPI`, that is used by the following
13+
into a static variable, :c:data:`PyDateTimeAPI`, that is used by the following
1414
macros.
1515

16+
.. c:macro:: PyDateTime_IMPORT()
17+
18+
Import the datetime C API.
19+
20+
On success, populate the :c:var:`PyDateTimeAPI` pointer.
21+
On failure, set :c:var:`PyDateTimeAPI` to ``NULL`` and set an exception.
22+
The caller must check if an error occurred via :c:func:`PyErr_Occurred`:
23+
24+
.. code-block::
25+
26+
PyDateTime_IMPORT;
27+
if (PyErr_Occurred()) { /* cleanup */ }
28+
29+
.. warning::
30+
31+
This is not compatible with subinterpreters.
32+
33+
.. c:type:: PyDateTime_CAPI
34+
35+
Structure containing the fields for the datetime C API.
36+
37+
The fields of this structure are private and subject to change.
38+
39+
Do not use this directly; prefer ``PyDateTime_*`` APIs instead.
40+
41+
.. c:var:: PyDateTime_CAPI *PyDateTimeAPI
42+
43+
Dynamically allocated object containing the datetime C API.
44+
45+
This variable is only available once :c:macro:`PyDateTime_IMPORT` succeeds.
46+
1647
.. c:type:: PyDateTime_Date
1748
1849
This subtype of :c:type:`PyObject` represents a Python date object.
@@ -325,3 +356,16 @@ Macros for the convenience of modules implementing the DB API:
325356
326357
Create and return a new :class:`datetime.date` object given an argument
327358
tuple suitable for passing to :meth:`datetime.date.fromtimestamp`.
359+
360+
361+
Internal data
362+
-------------
363+
364+
The following symbols are exposed by the C API but should be considered
365+
internal-only.
366+
367+
.. c:macro:: PyDateTime_CAPSULE_NAME
368+
369+
Name of the datetime capsule to pass to :c:func:`PyCapsule_Import`.
370+
371+
Internal usage only. Use :c:macro:`PyDateTime_IMPORT` instead.

Doc/c-api/gen.rst

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,3 +44,41 @@ than explicitly calling :c:func:`PyGen_New` or :c:func:`PyGen_NewWithQualName`.
4444
with ``__name__`` and ``__qualname__`` set to *name* and *qualname*.
4545
A reference to *frame* is stolen by this function. The *frame* argument
4646
must not be ``NULL``.
47+
48+
.. c:function:: PyCodeObject* PyGen_GetCode(PyGenObject *gen)
49+
50+
Return a new :term:`strong reference` to the code object wrapped by *gen*.
51+
This function always succeeds.
52+
53+
54+
Asynchronous Generator Objects
55+
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
56+
57+
.. seealso::
58+
:pep:`525`
59+
60+
.. c:var:: PyTypeObject PyAsyncGen_Type
61+
62+
The type object corresponding to asynchronous generator objects. This is
63+
available as :class:`types.AsyncGeneratorType` in the Python layer.
64+
65+
.. versionadded:: 3.6
66+
67+
.. c:function:: PyObject *PyAsyncGen_New(PyFrameObject *frame, PyObject *name, PyObject *qualname)
68+
69+
Create a new asynchronous generator wrapping *frame*, with ``__name__`` and
70+
``__qualname__`` set to *name* and *qualname*. *frame* is stolen by this
71+
function and must not be ``NULL``.
72+
73+
On success, this function returns a :term:`strong reference` to the
74+
new asynchronous generator. On failure, this function returns ``NULL``
75+
with an exception set.
76+
77+
.. versionadded:: 3.6
78+
79+
.. c:function:: int PyAsyncGen_CheckExact(PyObject *op)
80+
81+
Return true if *op* is an asynchronous generator object, false otherwise.
82+
This function always succeeds.
83+
84+
.. versionadded:: 3.6

Doc/c-api/import.rst

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -314,6 +314,13 @@ Importing Modules
314314
initialization.
315315
316316
317+
.. c:var:: struct _inittab *PyImport_Inittab
318+
319+
The table of built-in modules used by Python initialization. Do not use this directly;
320+
use :c:func:`PyImport_AppendInittab` and :c:func:`PyImport_ExtendInittab`
321+
instead.
322+
323+
317324
.. c:function:: PyObject* PyImport_ImportModuleAttr(PyObject *mod_name, PyObject *attr_name)
318325
319326
Import the module *mod_name* and get its attribute *attr_name*.
@@ -353,4 +360,4 @@ Importing Modules
353360
354361
On error, return NULL with an exception set.
355362
356-
.. versionadded:: next
363+
.. versionadded:: 3.15

0 commit comments

Comments
 (0)