Skip to content

Commit

Permalink
Merge branch 'main' into pythongh-125413-info
Browse files Browse the repository at this point in the history
  • Loading branch information
barneygale authored Jan 5, 2025
2 parents 2624363 + 2228e92 commit 662fd2d
Show file tree
Hide file tree
Showing 114 changed files with 7,408 additions and 4,283 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ jobs:
# reproducible: to get the same tools versions (autoconf, aclocal, ...)
runs-on: ubuntu-24.04
container:
image: ghcr.io/python/autoconf:2024.11.11.11786316759
image: ghcr.io/python/autoconf:2025.01.02.12581854023
timeout-minutes: 60
needs: check_source
if: needs.check_source.outputs.run_tests == 'true'
Expand All @@ -63,7 +63,7 @@ jobs:
run: echo "IMAGE_VERSION=${ImageVersion}" >> "$GITHUB_ENV"
- name: Check Autoconf and aclocal versions
run: |
grep "Generated by GNU Autoconf 2.71" configure
grep "Generated by GNU Autoconf 2.72" configure
grep "aclocal 1.16.5" aclocal.m4
grep -q "runstatedir" configure
grep -q "PKG_PROG_PKG_CONFIG" aclocal.m4
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/reusable-docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ jobs:
# Run "doctest" on HEAD as new syntax doesn't exist in the latest stable release
doctest:
name: 'Doctest'
runs-on: ubuntu-22.04
runs-on: ubuntu-24.04
timeout-minutes: 60
steps:
- uses: actions/checkout@v4
Expand Down
1 change: 1 addition & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ repos:
hooks:
- id: check-dependabot
- id: check-github-workflows
- id: check-readthedocs

- repo: https://github.com/rhysd/actionlint
rev: v1.7.4
Expand Down
15 changes: 8 additions & 7 deletions Doc/about.rst
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
=====================
About these documents
=====================
========================
About this documentation
========================


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

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

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


Contributors to the Python Documentation
Contributors to the Python documentation
----------------------------------------

Many people have contributed to the Python language, the Python standard
Expand Down
7 changes: 7 additions & 0 deletions Doc/c-api/object.rst
Original file line number Diff line number Diff line change
Expand Up @@ -493,6 +493,13 @@ Object Protocol
on failure. This is equivalent to the Python statement ``del o[key]``.
.. c:function:: int PyObject_DelItemString(PyObject *o, const char *key)
This is the same as :c:func:`PyObject_DelItem`, but *key* is
specified as a :c:expr:`const char*` UTF-8 encoded bytes string,
rather than a :c:expr:`PyObject*`.
.. c:function:: PyObject* PyObject_Dir(PyObject *o)
This is equivalent to the Python expression ``dir(o)``, returning a (possibly
Expand Down
4 changes: 1 addition & 3 deletions Doc/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,9 +101,7 @@

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

# Ignore any .rst files in the includes/ directory;
# they're embedded in pages but not rendered as individual pages.
Expand Down
5 changes: 5 additions & 0 deletions Doc/deprecations/pending-removal-in-3.16.rst
Original file line number Diff line number Diff line change
Expand Up @@ -79,3 +79,8 @@ Pending removal in Python 3.16

* The undocumented and unused :attr:`!TarFile.tarfile` attribute
has been deprecated since Python 3.13.

* :mod:`functools`:

* Calling the Python implementation of :func:`functools.reduce` with *function*
or *sequence* as keyword arguments has been deprecated since Python 3.14.
6 changes: 4 additions & 2 deletions Doc/howto/free-threading-extensions.rst
Original file line number Diff line number Diff line change
Expand Up @@ -96,8 +96,10 @@ Most of the C API is thread-safe, but there are some exceptions.

* **Struct Fields**: Accessing fields in Python C API objects or structs
directly is not thread-safe if the field may be concurrently modified.
* **Macros**: Accessor macros like :c:macro:`PyList_GET_ITEM` and
:c:macro:`PyList_SET_ITEM` do not perform any error checking or locking.
* **Macros**: Accessor macros like :c:macro:`PyList_GET_ITEM`,
:c:macro:`PyList_SET_ITEM`, and macros like
:c:macro:`PySequence_Fast_GET_SIZE` that use the object returned by
:c:func:`PySequence_Fast` do not perform any error checking or locking.
These macros are not thread-safe if the container object may be modified
concurrently.
* **Borrowed References**: C API functions that return
Expand Down
64 changes: 60 additions & 4 deletions Doc/library/calendar.rst
Original file line number Diff line number Diff line change
Expand Up @@ -138,21 +138,69 @@ interpreted as prescribed by the ISO 8601 standard. Year 0 is 1 BC, year -1 is

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

.. method:: formatmonth(theyear, themonth, w=0, l=0)

.. method:: formatday(theday, weekday, width)

Return a string representing a single day formatted with the given *width*.
If *theday* is ``0``, return a string of spaces of
the specified width, representing an empty day. The *weekday* parameter
is unused.

.. method:: formatweek(theweek, w=0, highlight_day=None)

Return a single week in a string with no newline. If *w* is provided, it
specifies the width of the date columns, which are centered. Depends
on the first weekday as specified in the constructor or set by the
:meth:`setfirstweekday` method.

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


.. method:: formatweekday(weekday, width)

Return a string representing the name of a single weekday formatted to
the specified *width*. The *weekday* parameter is an integer representing
the day of the week, where ``0`` is Monday and ``6`` is Sunday.


.. method:: formatweekheader(width)

Return a string containing the header row of weekday names, formatted
with the given *width* for each column. The names depend on the locale
settings and are padded to the specified width.


.. method:: formatmonth(theyear, themonth, w=0, l=0, highlight_day=None)

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

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


.. method:: formatmonthname(theyear, themonth, width=0, withyear=True)

Return a string representing the month's name centered within the
specified *width*. If *withyear* is ``True``, include the year in the
output. The *theyear* and *themonth* parameters specify the year
and month for the name to be formatted respectively.


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

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


.. method:: formatyear(theyear, w=2, l=1, c=6, m=3)
.. method:: formatyear(theyear, w=2, l=1, c=6, m=3, highlight_day=None)

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

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


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

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

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

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

.. _calendar-cli:

Command-Line Usage
Command-line usage
------------------

.. versionadded:: 2.5
Expand Down Expand Up @@ -654,6 +707,9 @@ The following options are accepted:
The number of months printed per row.
Defaults to 3.

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

*HTML-mode options:*

Expand Down
22 changes: 22 additions & 0 deletions Doc/library/ctypes.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2182,6 +2182,28 @@ Utility functions
.. audit-event:: ctypes.wstring_at ptr,size ctypes.wstring_at


.. function:: memoryview_at(ptr, size, readonly=False)

Return a :class:`memoryview` object of length *size* that references memory
starting at *void \*ptr*.

If *readonly* is true, the returned :class:`!memoryview` object can
not be used to modify the underlying memory.
(Changes made by other means will still be reflected in the returned
object.)

This function is similar to :func:`string_at` with the key
difference of not making a copy of the specified memory.
It is a semantically equivalent (but more efficient) alternative to
``memoryview((c_byte * size).from_address(ptr))``.
(While :meth:`~_CData.from_address` only takes integers, *ptr* can also
be given as a :class:`ctypes.POINTER` or a :func:`~ctypes.byref` object.)

.. audit-event:: ctypes.memoryview_at address,size,readonly

.. versionadded:: next


.. _ctypes-data-types:

Data types
Expand Down
6 changes: 3 additions & 3 deletions Doc/library/decimal.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1033,7 +1033,7 @@ New contexts can also be created using the :class:`Context` constructor
described below. In addition, the module provides three pre-made contexts:


.. class:: BasicContext
.. data:: BasicContext

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


.. class:: ExtendedContext
.. data:: ExtendedContext

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


.. class:: DefaultContext
.. data:: DefaultContext

This context is used by the :class:`Context` constructor as a prototype for new
contexts. Changing a field (such a precision) has the effect of changing the
Expand Down
4 changes: 4 additions & 0 deletions Doc/library/faulthandler.rst
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,10 @@ Fault handler state
The dump now mentions if a garbage collector collection is running
if *all_threads* is true.

.. versionchanged:: next
Only the current thread is dumped if the :term:`GIL` is disabled to
prevent the risk of data races.

.. function:: disable()

Disable the fault handler: uninstall the signal handlers installed by
Expand Down
Loading

0 comments on commit 662fd2d

Please sign in to comment.