Skip to content

Commit 2749ff8

Browse files
committed
Merge remote-tracking branch 'upstream/main' into 3.14-calendar-colour
2 parents e31133f + 8abd6ce commit 2749ff8

File tree

68 files changed

+5152
-3457
lines changed

Some content is hidden

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

68 files changed

+5152
-3457
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

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/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: 30 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,13 @@ 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:: formatday(theday, weekday, width)
142+
143+
Return a string representing a single day formatted with the given *width*.
144+
If *theday* is ``0``, return a string of spaces of
145+
the specified width, representing an empty day. The *weekday* parameter
146+
is unused.
147+
141148
.. method:: formatweek(theweek, w=0, highlight_day=None)
142149

143150
Return a single week in a string with no newline. If *w* is provided, it
@@ -151,6 +158,20 @@ interpreted as prescribed by the ISO 8601 standard. Year 0 is 1 BC, year -1 is
151158
<using-on-controlling-color>`.
152159

153160

161+
.. method:: formatweekday(weekday, width)
162+
163+
Return a string representing the name of a single weekday formatted to
164+
the specified *width*. The *weekday* parameter is an integer representing
165+
the day of the week, where ``0`` is Monday and ``6`` is Sunday.
166+
167+
168+
.. method:: formatweekheader(width)
169+
170+
Return a string containing the header row of weekday names, formatted
171+
with the given *width* for each column. The names depend on the locale
172+
settings and are padded to the specified width.
173+
174+
154175
.. method:: formatmonth(theyear, themonth, w=0, l=0, highlight_day=None)
155176

156177
Return a month's calendar in a multi-line string. If *w* is provided, it
@@ -165,6 +186,14 @@ interpreted as prescribed by the ISO 8601 standard. Year 0 is 1 BC, year -1 is
165186
<using-on-controlling-color>`.
166187

167188

189+
.. method:: formatmonthname(theyear, themonth, width=0, withyear=True)
190+
191+
Return a string representing the month's name centered within the
192+
specified *width*. If *withyear* is ``True``, include the year in the
193+
output. The *theyear* and *themonth* parameters specify the year
194+
and month for the name to be formatted respectively.
195+
196+
168197
.. method:: prmonth(theyear, themonth, w=0, l=0)
169198

170199
Print a month's calendar as returned by :meth:`formatmonth`.
@@ -460,7 +489,7 @@ The :mod:`calendar` module exports the following data attributes:
460489

461490
A sequence that represents the months of the year in the current locale. This
462491
follows normal convention of January being month number 1, so it has a length of
463-
13 and ``month_name[0]`` is the empty string.
492+
13 and ``month_name[0]`` is the empty string.
464493

465494
>>> import calendar
466495
>>> list(calendar.month_name)

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

Doc/library/pyexpat.rst

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -941,6 +941,13 @@ The ``errors`` module has the following attributes:
941941
has been breached.
942942

943943

944+
.. data:: XML_ERROR_NOT_STARTED
945+
946+
The parser was tried to be stopped or suspended before it started.
947+
948+
.. versionadded:: next
949+
950+
944951
.. rubric:: Footnotes
945952

946953
.. [1] The encoding string included in XML output should conform to the

Doc/library/re.rst

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -572,11 +572,8 @@ character ``'$'``.
572572
Word boundaries are determined by the current locale
573573
if the :py:const:`~re.LOCALE` flag is used.
574574

575-
.. note::
576-
577-
Note that ``\B`` does not match an empty string, which differs from
578-
RE implementations in other programming languages such as Perl.
579-
This behavior is kept for compatibility reasons.
575+
.. versionchanged:: next
576+
``\B`` now matches empty input string.
580577

581578
.. index:: single: \d; in regular expressions
582579

Doc/library/turtle.rst

Lines changed: 19 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1823,7 +1823,8 @@ Window control
18231823

18241824
.. function:: bgpic(picname=None)
18251825

1826-
:param picname: a string, name of a gif-file or ``"nopic"``, or ``None``
1826+
:param picname: a string, name of an image file (PNG, GIF, PGM, and PPM)
1827+
or ``"nopic"``, or ``None``
18271828

18281829
Set background image or return name of current backgroundimage. If *picname*
18291830
is a filename, set the corresponding image as background. If *picname* is
@@ -2200,9 +2201,9 @@ Settings and special methods
22002201
.. function:: register_shape(name, shape=None)
22012202
addshape(name, shape=None)
22022203

2203-
There are three different ways to call this function:
2204+
There are four different ways to call this function:
22042205

2205-
(1) *name* is the name of a gif-file and *shape* is ``None``: Install the
2206+
(1) *name* is the name of an image file (PNG, GIF, PGM, and PPM) and *shape* is ``None``: Install the
22062207
corresponding image shape. ::
22072208

22082209
>>> screen.register_shape("turtle.gif")
@@ -2211,20 +2212,33 @@ Settings and special methods
22112212
Image shapes *do not* rotate when turning the turtle, so they do not
22122213
display the heading of the turtle!
22132214

2214-
(2) *name* is an arbitrary string and *shape* is a tuple of pairs of
2215+
(2) *name* is an arbitrary string and *shape* is the name of an image file (PNG, GIF, PGM, and PPM): Install the
2216+
corresponding image shape. ::
2217+
2218+
>>> screen.register_shape("turtle", "turtle.gif")
2219+
2220+
.. note::
2221+
Image shapes *do not* rotate when turning the turtle, so they do not
2222+
display the heading of the turtle!
2223+
2224+
(3) *name* is an arbitrary string and *shape* is a tuple of pairs of
22152225
coordinates: Install the corresponding polygon shape.
22162226

22172227
.. doctest::
22182228
:skipif: _tkinter is None
22192229

22202230
>>> screen.register_shape("triangle", ((5,-3), (0,5), (-5,-3)))
22212231

2222-
(3) *name* is an arbitrary string and *shape* is a (compound) :class:`Shape`
2232+
(4) *name* is an arbitrary string and *shape* is a (compound) :class:`Shape`
22232233
object: Install the corresponding compound shape.
22242234

22252235
Add a turtle shape to TurtleScreen's shapelist. Only thusly registered
22262236
shapes can be used by issuing the command ``shape(shapename)``.
22272237

2238+
.. versionchanged:: next
2239+
Added support for PNG, PGM, and PPM image formats.
2240+
Both a shape name and an image file name can be specified.
2241+
22282242

22292243
.. function:: turtles()
22302244

0 commit comments

Comments
 (0)