Skip to content

Commit 37ec841

Browse files
committed
Merge branch 'master' into long_export-decimal
2 parents 5a00ee2 + 8d15058 commit 37ec841

File tree

163 files changed

+8538
-5075
lines changed

Some content is hidden

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

163 files changed

+8538
-5075
lines changed

.github/workflows/build.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ jobs:
4646
# reproducible: to get the same tools versions (autoconf, aclocal, ...)
4747
runs-on: ubuntu-24.04
4848
container:
49-
image: ghcr.io/python/autoconf:2024.11.11.11786316759
49+
image: ghcr.io/python/autoconf:2025.01.02.12581854023
5050
timeout-minutes: 60
5151
needs: check_source
5252
if: needs.check_source.outputs.run_tests == 'true'
@@ -63,7 +63,7 @@ jobs:
6363
run: echo "IMAGE_VERSION=${ImageVersion}" >> "$GITHUB_ENV"
6464
- name: Check Autoconf and aclocal versions
6565
run: |
66-
grep "Generated by GNU Autoconf 2.71" configure
66+
grep "Generated by GNU Autoconf 2.72" configure
6767
grep "aclocal 1.16.5" aclocal.m4
6868
grep -q "runstatedir" configure
6969
grep -q "PKG_PROG_PKG_CONFIG" aclocal.m4

.github/workflows/reusable-docs.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ jobs:
9999
# Run "doctest" on HEAD as new syntax doesn't exist in the latest stable release
100100
doctest:
101101
name: 'Doctest'
102-
runs-on: ubuntu-22.04
102+
runs-on: ubuntu-24.04
103103
timeout-minutes: 60
104104
steps:
105105
- uses: actions/checkout@v4

.pre-commit-config.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ repos:
5555
hooks:
5656
- id: check-dependabot
5757
- id: check-github-workflows
58+
- id: check-readthedocs
5859

5960
- repo: https://github.com/rhysd/actionlint
6061
rev: v1.7.4

Doc/about.rst

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
1-
=====================
2-
About these documents
3-
=====================
1+
========================
2+
About this documentation
3+
========================
44

55

6-
These documents are generated from `reStructuredText`_ sources by `Sphinx`_, a
7-
document processor specifically written for the Python documentation.
6+
Python's documentation is generated from `reStructuredText`_ sources
7+
using `Sphinx`_, a documentation generator originally created for Python
8+
and now maintained as an independent project.
89

910
.. _reStructuredText: https://docutils.sourceforge.io/rst.html
1011
.. _Sphinx: https://www.sphinx-doc.org/
@@ -20,14 +21,14 @@ volunteers are always welcome!
2021
Many thanks go to:
2122

2223
* Fred L. Drake, Jr., the creator of the original Python documentation toolset
23-
and writer of much of the content;
24+
and author of much of the content;
2425
* the `Docutils <https://docutils.sourceforge.io/>`_ project for creating
2526
reStructuredText and the Docutils suite;
2627
* Fredrik Lundh for his Alternative Python Reference project from which Sphinx
2728
got many good ideas.
2829

2930

30-
Contributors to the Python Documentation
31+
Contributors to the Python documentation
3132
----------------------------------------
3233

3334
Many people have contributed to the Python language, the Python standard

Doc/c-api/arg.rst

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -229,12 +229,24 @@ There are three ways strings and buffers can be converted to C:
229229
Numbers
230230
-------
231231

232+
These formats allow representing Python numbers or single characters as C numbers.
233+
Formats that require :class:`int`, :class:`float` or :class:`complex` can
234+
also use the corresponding special methods :meth:`~object.__index__`,
235+
:meth:`~object.__float__` or :meth:`~object.__complex__` to convert
236+
the Python object to the required type.
237+
238+
For signed integer formats, :exc:`OverflowError` is raised if the value
239+
is out of range for the C type.
240+
For unsigned integer formats, no range checking is done --- the
241+
most significant bits are silently truncated when the receiving field is too
242+
small to receive the value.
243+
232244
``b`` (:class:`int`) [unsigned char]
233-
Convert a nonnegative Python integer to an unsigned tiny int, stored in a C
245+
Convert a nonnegative Python integer to an unsigned tiny integer, stored in a C
234246
:c:expr:`unsigned char`.
235247

236248
``B`` (:class:`int`) [unsigned char]
237-
Convert a Python integer to a tiny int without overflow checking, stored in a C
249+
Convert a Python integer to a tiny integer without overflow checking, stored in a C
238250
:c:expr:`unsigned char`.
239251

240252
``h`` (:class:`int`) [short int]
@@ -344,12 +356,6 @@ Other objects
344356
in *items*. The C arguments must correspond to the individual format units in
345357
*items*. Format units for sequences may be nested.
346358

347-
It is possible to pass "long" integers (integers whose value exceeds the
348-
platform's :c:macro:`LONG_MAX`) however no proper range checking is done --- the
349-
most significant bits are silently truncated when the receiving field is too
350-
small to receive the value (actually, the semantics are inherited from downcasts
351-
in C --- your mileage may vary).
352-
353359
A few other characters have a meaning in a format string. These may not occur
354360
inside nested parentheses. They are:
355361

Doc/c-api/object.rst

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,8 @@ Object Protocol
111111
.. note::
112112
113113
Exceptions that occur when this calls :meth:`~object.__getattr__` and
114-
:meth:`~object.__getattribute__` methods are silently ignored.
114+
:meth:`~object.__getattribute__` methods aren't propagated,
115+
but instead given to :func:`sys.unraisablehook`.
115116
For proper error handling, use :c:func:`PyObject_HasAttrWithError`,
116117
:c:func:`PyObject_GetOptionalAttr` or :c:func:`PyObject_GetAttr` instead.
117118
@@ -492,6 +493,13 @@ Object Protocol
492493
on failure. This is equivalent to the Python statement ``del o[key]``.
493494
494495
496+
.. c:function:: int PyObject_DelItemString(PyObject *o, const char *key)
497+
498+
This is the same as :c:func:`PyObject_DelItem`, but *key* is
499+
specified as a :c:expr:`const char*` UTF-8 encoded bytes string,
500+
rather than a :c:expr:`PyObject*`.
501+
502+
495503
.. c:function:: PyObject* PyObject_Dir(PyObject *o)
496504
497505
This is equivalent to the Python expression ``dir(o)``, returning a (possibly

Doc/c-api/typeobj.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1023,6 +1023,7 @@ and :c:data:`PyType_Type` effectively act as defaults.)
10231023
:c:macro:`Py_TPFLAGS_HAVE_GC` flag bit is clear in the subtype and the
10241024
:c:member:`~PyTypeObject.tp_traverse` and :c:member:`~PyTypeObject.tp_clear` fields in the subtype exist and have
10251025
``NULL`` values.
1026+
10261027
.. XXX are most flag bits *really* inherited individually?
10271028
10281029
**Default:**

Doc/conf.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -101,9 +101,7 @@
101101

102102
# Create table of contents entries for domain objects (e.g. functions, classes,
103103
# attributes, etc.). Default is True.
104-
toc_object_entries = True
105-
# Hide parents to tidy up long entries in sidebar
106-
toc_object_entries_show_parents = 'hide'
104+
toc_object_entries = False
107105

108106
# Ignore any .rst files in the includes/ directory;
109107
# they're embedded in pages but not rendered as individual pages.

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

Lines changed: 31 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,35 @@ Pending removal in Python 3.16
1919
* :mod:`asyncio`:
2020

2121
* :func:`!asyncio.iscoroutinefunction` is deprecated
22-
and will be removed in Python 3.16,
22+
and will be removed in Python 3.16;
2323
use :func:`inspect.iscoroutinefunction` instead.
2424
(Contributed by Jiahao Li and Kumar Aditya in :gh:`122875`.)
2525

26+
* :mod:`asyncio` policy system is deprecated and will be removed in Python 3.16.
27+
In particular, the following classes and functions are deprecated:
28+
29+
* :class:`asyncio.AbstractEventLoopPolicy`
30+
* :class:`asyncio.DefaultEventLoopPolicy`
31+
* :class:`asyncio.WindowsSelectorEventLoopPolicy`
32+
* :class:`asyncio.WindowsProactorEventLoopPolicy`
33+
* :func:`asyncio.get_event_loop_policy`
34+
* :func:`asyncio.set_event_loop_policy`
35+
* :func:`asyncio.set_event_loop`
36+
37+
Users should use :func:`asyncio.run` or :class:`asyncio.Runner` with
38+
*loop_factory* to use the desired event loop implementation.
39+
40+
For example, to use :class:`asyncio.SelectorEventLoop` on Windows::
41+
42+
import asyncio
43+
44+
async def main():
45+
...
46+
47+
asyncio.run(main(), loop_factory=asyncio.SelectorEventLoop)
48+
49+
(Contributed by Kumar Aditya in :gh:`127949`.)
50+
2651
* :mod:`builtins`:
2752

2853
* Bitwise inversion on boolean types, ``~True`` or ``~False``
@@ -54,3 +79,8 @@ Pending removal in Python 3.16
5479

5580
* The undocumented and unused :attr:`!TarFile.tarfile` attribute
5681
has been deprecated since Python 3.13.
82+
83+
* :mod:`functools`:
84+
85+
* Calling the Python implementation of :func:`functools.reduce` with *function*
86+
or *sequence* as keyword arguments has been deprecated since Python 3.14.

Doc/howto/free-threading-extensions.rst

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -96,8 +96,10 @@ Most of the C API is thread-safe, but there are some exceptions.
9696

9797
* **Struct Fields**: Accessing fields in Python C API objects or structs
9898
directly is not thread-safe if the field may be concurrently modified.
99-
* **Macros**: Accessor macros like :c:macro:`PyList_GET_ITEM` and
100-
:c:macro:`PyList_SET_ITEM` do not perform any error checking or locking.
99+
* **Macros**: Accessor macros like :c:macro:`PyList_GET_ITEM`,
100+
:c:macro:`PyList_SET_ITEM`, and macros like
101+
:c:macro:`PySequence_Fast_GET_SIZE` that use the object returned by
102+
:c:func:`PySequence_Fast` do not perform any error checking or locking.
101103
These macros are not thread-safe if the container object may be modified
102104
concurrently.
103105
* **Borrowed References**: C API functions that return

0 commit comments

Comments
 (0)