Skip to content

Commit 1978b2d

Browse files
authored
Merge branch '3.13' into backport-1b424c0-3.13
2 parents f3f5234 + 36dbdc2 commit 1978b2d

153 files changed

Lines changed: 2829 additions & 814 deletions

File tree

Some content is hidden

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

‎.github/workflows/reusable-docs.yml‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,9 @@ jobs:
8686
--fail-if-regression \
8787
--fail-if-improved \
8888
--fail-if-new-news-nit
89+
- name: 'Build list of changes'
90+
run: |
91+
make -C Doc/ PYTHON=../python changes
8992
9093
# Run "doctest" on HEAD as new syntax doesn't exist in the latest stable release
9194
doctest:
File renamed without changes.
File renamed without changes.
File renamed without changes.

‎Doc/builtins/index.rst‎

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
.. _builtins-index:
2+
3+
##############################
4+
Python built-ins reference
5+
##############################
6+
7+
Python comes with a number of built-in functions and classes.
8+
9+
The built-in classes include data types that would normally be considered part
10+
of the "core" of a language, such as numbers and lists. For these types, the
11+
Python language core defines the form of literals and places some constraints
12+
on their semantics, but does not fully define the semantics.
13+
14+
The built-ins also include functions and exceptions --- objects that can
15+
be used by all Python code without the need of an :keyword:`import` statement.
16+
Some of these are defined by the core language, but many are not essential for
17+
the core semantics and are only described here.
18+
19+
.. seealso::
20+
21+
In addition to the built-ins, Python provides an extensive importable
22+
standard library, see :ref:`library-index`.
23+
24+
.. We don't use :numbered: option for the TOC below as it enforces
25+
numbered sections for the entire builtin docs. If desired,
26+
:numbered: can be enabled on a per-page basis.
27+
.. toctree::
28+
:maxdepth: 2
29+
30+
stdtypes.rst
31+
constants.rst
32+
functions.rst
33+
exceptions.rst
File renamed without changes.

‎Doc/c-api/bytearray.rst‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,12 @@ Byte Array Objects
1212
1313
This subtype of :c:type:`PyObject` represents a Python bytearray object.
1414

15+
.. impl-detail::
16+
17+
The internal buffer of :c:type:`PyByteArrayObject` always includes an
18+
extra trailing null byte for compatibility with null terminated C
19+
strings. This extra byte is not counted in :c:func:`PyByteArray_Size`
20+
nor in the *len* arguments of the functions below.
1521

1622
.. c:var:: PyTypeObject PyByteArray_Type
1723

‎Doc/c-api/bytes.rst‎

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,13 @@ Bytes Objects
88
These functions raise :exc:`TypeError` when expecting a bytes parameter and
99
called with a non-bytes parameter.
1010

11+
.. impl-detail::
12+
13+
The internal buffer of :c:type:`PyBytesObject` always includes an extra
14+
trailing null byte for compatibility with null terminated C strings.
15+
This extra byte is not counted in :c:func:`PyBytes_Size` nor in the
16+
various *length* and *size* arguments of the functions below.
17+
1118
.. index:: pair: object; bytes
1219

1320

‎Doc/conf.py‎

Lines changed: 33 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,8 @@
4242
'sphinx_linklint.ext',
4343
'notfound.extension',
4444
'sphinxext.opengraph',
45+
'sphinxext.rediraffe',
46+
'sphinxcontrib.rsvgconverter',
4547
)
4648
for optional_ext in _OPTIONAL_EXTENSIONS:
4749
try:
@@ -74,6 +76,8 @@
7476
# and replace the values accordingly.
7577
# See Doc/tools/extensions/patchlevel.py
7678
version, release = get_version_info()
79+
v = get_header_version_info()
80+
branch = "main" if v.releaselevel == "alpha" else f"{v.major}.{v.minor}"
7781

7882
rst_epilog = f"""
7983
.. |python_version_literal| replace:: ``Python {version}``
@@ -292,6 +296,7 @@
292296
"repository_url": repository_url or None,
293297
"pr_id": os.getenv("READTHEDOCS_VERSION"),
294298
"enable_analytics": os.getenv("PYTHON_DOCS_ENABLE_ANALYTICS"),
299+
"source_branch": branch,
295300
}
296301

297302
# This 'Last updated on:' timestamp is inserted at the bottom of every page.
@@ -301,6 +306,9 @@
301306
# Path to find HTML templates to override theme
302307
templates_path = ['tools/templates']
303308

309+
# We link to sources on GitHub, so don't copy them into the HTML output.
310+
html_copy_source = False
311+
304312
# Custom sidebar templates, filenames relative to this file.
305313
html_sidebars = {
306314
# Defaults taken from https://www.sphinx-doc.org/en/master/usage/configuration.html#confval-html_sidebars
@@ -356,7 +364,13 @@
356364
# Grouping the document tree into LaTeX files. List of tuples
357365
# (source start file, target name, title, author, document class [howto/manual]).
358366
latex_documents = [
359-
('c-api/index', 'c-api.tex', 'The Python/C API', _doc_authors, 'manual'),
367+
(
368+
'c-api/index',
369+
'c-api.tex',
370+
'The Python/C API',
371+
_doc_authors,
372+
'manual',
373+
),
360374
(
361375
'extending/index',
362376
'extending.tex',
@@ -371,6 +385,13 @@
371385
_doc_authors,
372386
'manual',
373387
),
388+
(
389+
'builtins/index',
390+
'builtins.tex',
391+
'Python Built-ins Reference',
392+
_doc_authors,
393+
'manual',
394+
),
374395
(
375396
'library/index',
376397
'library.tex',
@@ -549,9 +570,6 @@
549570
# Options for sphinx.ext.extlinks
550571
# -------------------------------
551572

552-
v = get_header_version_info()
553-
branch = "main" if v.releaselevel == "alpha" else f"{v.major}.{v.minor}"
554-
555573
# This config is a dictionary of external sites,
556574
# mapping unique short aliases to a base URL and a prefix.
557575
# https://www.sphinx-doc.org/en/master/usage/extensions/extlinks.html
@@ -597,3 +615,14 @@
597615
'<meta property="og:image:width" content="200">',
598616
'<meta property="og:image:height" content="200">',
599617
)
618+
619+
# Options for sphinxext-rediraffe
620+
# -------------------------------
621+
622+
rediraffe_redirects = {
623+
# Splitting builtins from library
624+
"library/functions.rst": "builtins/functions.rst",
625+
"library/stdtypes.rst": "builtins/stdtypes.rst",
626+
"library/constants.rst": "builtins/constants.rst",
627+
"library/exceptions.rst": "builtins/exceptions.rst",
628+
}

‎Doc/contents.rst‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
tutorial/index.rst
99
using/index.rst
1010
reference/index.rst
11+
builtins/index.rst
1112
library/index.rst
1213
extending/index.rst
1314
c-api/index.rst

0 commit comments

Comments
 (0)