Skip to content

Commit 7af3a5b

Browse files
authored
Merge branch 'main' into gh-157378
2 parents 696c81f + a844747 commit 7af3a5b

97 files changed

Lines changed: 3690 additions & 750 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.
File renamed without changes.
File renamed without changes.
File renamed without changes.

Doc/builtins/index.rst

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
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
34+
threadsafety.rst
35+
time-complexity.rst
File renamed without changes.
File renamed without changes.
File renamed without changes.

Doc/conf.py

Lines changed: 28 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@
4444
'sphinx_linklint.ext',
4545
'notfound.extension',
4646
'sphinxext.opengraph',
47+
'sphinxext.rediraffe',
4748
'sphinxcontrib.rsvgconverter',
4849
)
4950
for optional_ext in _OPTIONAL_EXTENSIONS:
@@ -359,7 +360,13 @@
359360
# Grouping the document tree into LaTeX files. List of tuples
360361
# (source start file, target name, title, author, document class [howto/manual]).
361362
latex_documents = [
362-
('c-api/index', 'c-api.tex', 'The Python/C API', _doc_authors, 'manual'),
363+
(
364+
'c-api/index',
365+
'c-api.tex',
366+
'The Python/C API',
367+
_doc_authors,
368+
'manual',
369+
),
363370
(
364371
'extending/index',
365372
'extending.tex',
@@ -374,6 +381,13 @@
374381
_doc_authors,
375382
'manual',
376383
),
384+
(
385+
'builtins/index',
386+
'builtins.tex',
387+
'Python Built-ins Reference',
388+
_doc_authors,
389+
'manual',
390+
),
377391
(
378392
'library/index',
379393
'library.tex',
@@ -606,3 +620,16 @@
606620
'<meta property="og:image:width" content="200">',
607621
'<meta property="og:image:height" content="200">',
608622
)
623+
624+
# Options for sphinxext-rediraffe
625+
# -------------------------------
626+
627+
rediraffe_redirects = {
628+
# Splitting builtins from library
629+
"library/functions.rst": "builtins/functions.rst",
630+
"library/stdtypes.rst": "builtins/stdtypes.rst",
631+
"library/constants.rst": "builtins/constants.rst",
632+
"library/exceptions.rst": "builtins/exceptions.rst",
633+
"library/threadsafety.rst": "builtins/threadsafety.rst",
634+
"library/time-complexity.rst": "builtins/time-complexity.rst",
635+
}

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

Doc/extending/index.rst

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,10 @@ underlying operating system supports this feature.
1616

1717
This document assumes basic knowledge about C and Python. For an informal
1818
introduction to Python, see :ref:`tutorial-index`. :ref:`reference-index`
19-
gives a more formal definition of the language. :ref:`library-index` documents
20-
the existing object types, functions and modules (both built-in and written in
21-
Python) that give the language its wide application range.
19+
gives a more formal definition of the language. :ref:`builtins-index` documents
20+
the built-in functions and object types, and :ref:`library-index` documents the
21+
modules (both built-in and written in Python) that give the language its wide
22+
application range.
2223

2324
For a detailed description of the whole Python/C API, see the separate
2425
:ref:`c-api-index`.

0 commit comments

Comments
 (0)