Skip to content

Commit 7c3d3fc

Browse files
Merge branch 'main' into integer-upper-limit
2 parents c2af856 + 13f61bf commit 7c3d3fc

File tree

222 files changed

+5657
-3194
lines changed

Some content is hidden

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

222 files changed

+5657
-3194
lines changed

.github/CODEOWNERS

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -211,8 +211,9 @@ Doc/c-api/stable.rst @encukou
211211

212212
**/*ensurepip* @pfmoore @pradyunsg
213213

214-
**/*idlelib* @terryjreedy
215214
/Doc/library/idle.rst @terryjreedy
215+
**/*idlelib* @terryjreedy
216+
**/*turtledemo* @terryjreedy
216217

217218
**/*annotationlib* @JelleZijlstra
218219
**/*typing* @JelleZijlstra @AlexWaygood

.github/workflows/reusable-docs.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,9 @@ concurrency:
1111
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
1212
cancel-in-progress: true
1313

14+
env:
15+
FORCE_COLOR: 1
16+
1417
jobs:
1518
build_doc:
1619
name: 'Docs'

Doc/c-api/bytes.rst

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -189,6 +189,24 @@ called with a non-bytes parameter.
189189
to *newpart* (i.e. decrements its reference count).
190190
191191
192+
.. c:function:: PyObject* PyBytes_Join(PyObject *sep, PyObject *iterable)
193+
194+
Similar to ``sep.join(iterable)`` in Python.
195+
196+
*sep* must be Python :class:`bytes` object.
197+
(Note that :c:func:`PyUnicode_Join` accepts ``NULL`` separator and treats
198+
it as a space, whereas :c:func:`PyBytes_Join` doesn't accept ``NULL``
199+
separator.)
200+
201+
*iterable* must be an iterable object yielding objects that implement the
202+
:ref:`buffer protocol <bufferobjects>`.
203+
204+
On success, return a new :class:`bytes` object.
205+
On error, set an exception and return ``NULL``.
206+
207+
.. versionadded: 3.14
208+
209+
192210
.. c:function:: int _PyBytes_Resize(PyObject **bytes, Py_ssize_t newsize)
193211
194212
Resize a bytes object. *newsize* will be the new length of the bytes object.

Doc/c-api/datetime.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -318,10 +318,10 @@ Macros for the convenience of modules implementing the DB API:
318318
.. c:function:: PyObject* PyDateTime_FromTimestamp(PyObject *args)
319319
320320
Create and return a new :class:`datetime.datetime` object given an argument
321-
tuple suitable for passing to :meth:`datetime.datetime.fromtimestamp()`.
321+
tuple suitable for passing to :meth:`datetime.datetime.fromtimestamp`.
322322
323323
324324
.. c:function:: PyObject* PyDate_FromTimestamp(PyObject *args)
325325
326326
Create and return a new :class:`datetime.date` object given an argument
327-
tuple suitable for passing to :meth:`datetime.date.fromtimestamp()`.
327+
tuple suitable for passing to :meth:`datetime.date.fromtimestamp`.

Doc/c-api/exceptions.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ propagated, additional calls into the Python/C API may not behave as intended
3434
and may fail in mysterious ways.
3535

3636
.. note::
37-
The error indicator is **not** the result of :func:`sys.exc_info()`.
37+
The error indicator is **not** the result of :func:`sys.exc_info`.
3838
The former corresponds to an exception that is not yet caught (and is
3939
therefore still propagating), while the latter returns an exception after
4040
it is caught (and has therefore stopped propagating).

Doc/c-api/hash.rst

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,25 @@ See also the :c:member:`PyTypeObject.tp_hash` member and :ref:`numeric-hash`.
8989
9090
.. versionadded:: 3.13
9191
92+
93+
.. c:function:: Py_hash_t Py_HashBuffer(const void *ptr, Py_ssize_t len)
94+
95+
Compute and return the hash value of a buffer of *len* bytes
96+
starting at address *ptr*. The hash is guaranteed to match that of
97+
:class:`bytes`, :class:`memoryview`, and other built-in objects
98+
that implement the :ref:`buffer protocol <bufferobjects>`.
99+
100+
Use this function to implement hashing for immutable objects whose
101+
:c:member:`~PyTypeObject.tp_richcompare` function compares to another
102+
object's buffer.
103+
104+
*len* must be greater than or equal to ``0``.
105+
106+
This function always succeeds.
107+
108+
.. versionadded:: 3.14
109+
110+
92111
.. c:function:: Py_hash_t PyObject_GenericHash(PyObject *obj)
93112
94113
Generic hashing function that is meant to be put into a type

Doc/c-api/import.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,7 @@ Importing Modules
190190
191191
.. versionadded:: 3.2
192192
.. versionchanged:: 3.3
193-
Uses :func:`!imp.source_from_cache()` in calculating the source path if
193+
Uses :func:`!imp.source_from_cache` in calculating the source path if
194194
only the bytecode path is provided.
195195
.. versionchanged:: 3.12
196196
No longer uses the removed :mod:`!imp` module.

Doc/c-api/init_config.rst

Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1605,6 +1605,75 @@ customized Python always running in isolated mode using
16051605
:c:func:`Py_RunMain`.
16061606
16071607
1608+
Runtime Python configuration API
1609+
================================
1610+
1611+
The configuration option *name* parameter must be a non-NULL null-terminated
1612+
UTF-8 encoded string.
1613+
1614+
Some options are read from the :mod:`sys` attributes. For example, the option
1615+
``"argv"`` is read from :data:`sys.argv`.
1616+
1617+
1618+
.. c:function:: PyObject* PyConfig_Get(const char *name)
1619+
1620+
Get the current runtime value of a configuration option as a Python object.
1621+
1622+
* Return a new reference on success.
1623+
* Set an exception and return ``NULL`` on error.
1624+
1625+
The object type depends on the configuration option. It can be:
1626+
1627+
* ``bool``
1628+
* ``int``
1629+
* ``str``
1630+
* ``list[str]``
1631+
* ``dict[str, str]``
1632+
1633+
The caller must hold the GIL. The function cannot be called before
1634+
Python initialization nor after Python finalization.
1635+
1636+
.. versionadded:: 3.14
1637+
1638+
1639+
.. c:function:: int PyConfig_GetInt(const char *name, int *value)
1640+
1641+
Similar to :c:func:`PyConfig_Get`, but get the value as a C int.
1642+
1643+
* Return ``0`` on success.
1644+
* Set an exception and return ``-1`` on error.
1645+
1646+
.. versionadded:: 3.14
1647+
1648+
1649+
.. c:function:: PyObject* PyConfig_Names(void)
1650+
1651+
Get all configuration option names as a ``frozenset``.
1652+
1653+
* Return a new reference on success.
1654+
* Set an exception and return ``NULL`` on error.
1655+
1656+
The caller must hold the GIL. The function cannot be called before
1657+
Python initialization nor after Python finalization.
1658+
1659+
.. versionadded:: 3.14
1660+
1661+
1662+
.. c:function:: int PyConfig_Set(const char *name, PyObject *value)
1663+
1664+
Set the current runtime value of a configuration option.
1665+
1666+
* Raise a :exc:`ValueError` if there is no option *name*.
1667+
* Raise a :exc:`ValueError` if *value* is an invalid value.
1668+
* Raise a :exc:`ValueError` if the option is read-only (cannot be set).
1669+
* Raise a :exc:`TypeError` if *value* has not the proper type.
1670+
1671+
The caller must hold the GIL. The function cannot be called before
1672+
Python initialization nor after Python finalization.
1673+
1674+
.. versionadded:: 3.14
1675+
1676+
16081677
Py_GetArgcArgv()
16091678
================
16101679

Doc/conf.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -311,6 +311,7 @@
311311
# Allow translation of index directives
312312
gettext_additional_targets = [
313313
'index',
314+
'literal-block',
314315
]
315316

316317
# Options for HTML output

Doc/deprecations/pending-removal-in-3.13.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,5 +48,5 @@ APIs:
4848
* ``read_binary()``
4949
* ``read_text()``
5050

51-
Use :func:`importlib.resources.files()` instead. Refer to `importlib-resources: Migrating from Legacy
51+
Use :func:`importlib.resources.files` instead. Refer to `importlib-resources: Migrating from Legacy
5252
<https://importlib-resources.readthedocs.io/en/latest/using.html#migrating-from-legacy>`_ (:gh:`106531`)

0 commit comments

Comments
 (0)