Skip to content

Commit 32bbf68

Browse files
committed
Merge branch 'main' into fix-issue-126349
2 parents 061fe2a + b60044b commit 32bbf68

File tree

110 files changed

+7384
-4270
lines changed

Some content is hidden

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

110 files changed

+7384
-4270
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

.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/object.rst

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -493,6 +493,13 @@ Object Protocol
493493
on failure. This is equivalent to the Python statement ``del o[key]``.
494494
495495
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+
496503
.. c:function:: PyObject* PyObject_Dir(PyObject *o)
497504
498505
This is equivalent to the Python expression ``dir(o)``, returning a (possibly

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: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,3 +79,8 @@ Pending removal in Python 3.16
7979

8080
* The undocumented and unused :attr:`!TarFile.tarfile` attribute
8181
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

Doc/library/calendar.rst

Lines changed: 60 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -138,21 +138,69 @@ interpreted as prescribed by the ISO 8601 standard. Year 0 is 1 BC, year -1 is
138138

139139
:class:`TextCalendar` instances have the following methods:
140140

141-
.. method:: formatmonth(theyear, themonth, w=0, l=0)
141+
142+
.. method:: formatday(theday, weekday, width)
143+
144+
Return a string representing a single day formatted with the given *width*.
145+
If *theday* is ``0``, return a string of spaces of
146+
the specified width, representing an empty day. The *weekday* parameter
147+
is unused.
148+
149+
.. method:: formatweek(theweek, w=0, highlight_day=None)
150+
151+
Return a single week in a string with no newline. If *w* is provided, it
152+
specifies the width of the date columns, which are centered. Depends
153+
on the first weekday as specified in the constructor or set by the
154+
:meth:`setfirstweekday` method.
155+
156+
.. versionchanged:: next
157+
If *highlight_day* is given, this date is highlighted in color.
158+
This can be :ref:`controlled using environment variables
159+
<using-on-controlling-color>`.
160+
161+
162+
.. method:: formatweekday(weekday, width)
163+
164+
Return a string representing the name of a single weekday formatted to
165+
the specified *width*. The *weekday* parameter is an integer representing
166+
the day of the week, where ``0`` is Monday and ``6`` is Sunday.
167+
168+
169+
.. method:: formatweekheader(width)
170+
171+
Return a string containing the header row of weekday names, formatted
172+
with the given *width* for each column. The names depend on the locale
173+
settings and are padded to the specified width.
174+
175+
176+
.. method:: formatmonth(theyear, themonth, w=0, l=0, highlight_day=None)
142177

143178
Return a month's calendar in a multi-line string. If *w* is provided, it
144179
specifies the width of the date columns, which are centered. If *l* is
145180
given, it specifies the number of lines that each week will use. Depends
146181
on the first weekday as specified in the constructor or set by the
147182
:meth:`setfirstweekday` method.
148183

184+
.. versionchanged:: next
185+
If *highlight_day* is given, this date is highlighted in color.
186+
This can be :ref:`controlled using environment variables
187+
<using-on-controlling-color>`.
188+
189+
190+
.. method:: formatmonthname(theyear, themonth, width=0, withyear=True)
191+
192+
Return a string representing the month's name centered within the
193+
specified *width*. If *withyear* is ``True``, include the year in the
194+
output. The *theyear* and *themonth* parameters specify the year
195+
and month for the name to be formatted respectively.
196+
149197

150198
.. method:: prmonth(theyear, themonth, w=0, l=0)
151199

152200
Print a month's calendar as returned by :meth:`formatmonth`.
153201

154202

155-
.. method:: formatyear(theyear, w=2, l=1, c=6, m=3)
203+
.. method:: formatyear(theyear, w=2, l=1, c=6, m=3, highlight_day=None)
156204

157205
Return a *m*-column calendar for an entire year as a multi-line string.
158206
Optional parameters *w*, *l*, and *c* are for date column width, lines per
@@ -161,6 +209,11 @@ interpreted as prescribed by the ISO 8601 standard. Year 0 is 1 BC, year -1 is
161209
:meth:`setfirstweekday` method. The earliest year for which a calendar
162210
can be generated is platform-dependent.
163211

212+
.. versionchanged:: next
213+
If *highlight_day* is given, this date is highlighted in color.
214+
This can be :ref:`controlled using environment variables
215+
<using-on-controlling-color>`.
216+
164217

165218
.. method:: pryear(theyear, w=2, l=1, c=6, m=3)
166219

@@ -437,7 +490,7 @@ The :mod:`calendar` module exports the following data attributes:
437490

438491
A sequence that represents the months of the year in the current locale. This
439492
follows normal convention of January being month number 1, so it has a length of
440-
13 and ``month_name[0]`` is the empty string.
493+
13 and ``month_name[0]`` is the empty string.
441494

442495
>>> import calendar
443496
>>> list(calendar.month_name)
@@ -516,7 +569,7 @@ The :mod:`calendar` module defines the following exceptions:
516569

517570
.. _calendar-cli:
518571

519-
Command-Line Usage
572+
Command-line usage
520573
------------------
521574

522575
.. versionadded:: 2.5
@@ -654,6 +707,9 @@ The following options are accepted:
654707
The number of months printed per row.
655708
Defaults to 3.
656709

710+
.. versionchanged:: next
711+
By default, today's date is highlighted in color and can be
712+
:ref:`controlled using environment variables <using-on-controlling-color>`.
657713

658714
*HTML-mode options:*
659715

Doc/library/ctypes.rst

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2182,6 +2182,28 @@ Utility functions
21822182
.. audit-event:: ctypes.wstring_at ptr,size ctypes.wstring_at
21832183

21842184

2185+
.. function:: memoryview_at(ptr, size, readonly=False)
2186+
2187+
Return a :class:`memoryview` object of length *size* that references memory
2188+
starting at *void \*ptr*.
2189+
2190+
If *readonly* is true, the returned :class:`!memoryview` object can
2191+
not be used to modify the underlying memory.
2192+
(Changes made by other means will still be reflected in the returned
2193+
object.)
2194+
2195+
This function is similar to :func:`string_at` with the key
2196+
difference of not making a copy of the specified memory.
2197+
It is a semantically equivalent (but more efficient) alternative to
2198+
``memoryview((c_byte * size).from_address(ptr))``.
2199+
(While :meth:`~_CData.from_address` only takes integers, *ptr* can also
2200+
be given as a :class:`ctypes.POINTER` or a :func:`~ctypes.byref` object.)
2201+
2202+
.. audit-event:: ctypes.memoryview_at address,size,readonly
2203+
2204+
.. versionadded:: next
2205+
2206+
21852207
.. _ctypes-data-types:
21862208

21872209
Data types

Doc/library/decimal.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1033,7 +1033,7 @@ New contexts can also be created using the :class:`Context` constructor
10331033
described below. In addition, the module provides three pre-made contexts:
10341034

10351035

1036-
.. class:: BasicContext
1036+
.. data:: BasicContext
10371037

10381038
This is a standard context defined by the General Decimal Arithmetic
10391039
Specification. Precision is set to nine. Rounding is set to
@@ -1044,7 +1044,7 @@ described below. In addition, the module provides three pre-made contexts:
10441044
Because many of the traps are enabled, this context is useful for debugging.
10451045

10461046

1047-
.. class:: ExtendedContext
1047+
.. data:: ExtendedContext
10481048

10491049
This is a standard context defined by the General Decimal Arithmetic
10501050
Specification. Precision is set to nine. Rounding is set to
@@ -1057,7 +1057,7 @@ described below. In addition, the module provides three pre-made contexts:
10571057
presence of conditions that would otherwise halt the program.
10581058

10591059

1060-
.. class:: DefaultContext
1060+
.. data:: DefaultContext
10611061

10621062
This context is used by the :class:`Context` constructor as a prototype for new
10631063
contexts. Changing a field (such a precision) has the effect of changing the

0 commit comments

Comments
 (0)