Skip to content

Docs: split builtins to their own page from library - #156682

Open
nedbat wants to merge 2 commits into
python:mainfrom
nedbat:nedbat/split-builtin-stdlib
Open

Docs: split builtins to their own page from library#156682
nedbat wants to merge 2 commits into
python:mainfrom
nedbat:nedbat/split-builtin-stdlib

Conversation

@nedbat

@nedbat nedbat commented Aug 30, 2026

Copy link
Copy Markdown
Member

We've talked about separating the built-ins from the stdlib modules, since "dict" (for example) isn't part of the stdlib.

I think I took care of all the places the pages are referenced, but the non-HTML builds are new to me, so I might have missed something.

I tried to make the intro paragraphs and pages useful, and avoided over-editing them.

@nedbat
nedbat force-pushed the nedbat/split-builtin-stdlib branch from 37b2ad3 to 10c84e6 Compare August 30, 2026 20:10
@nedbat

nedbat commented Aug 30, 2026

Copy link
Copy Markdown
Member Author

Also: is this NEWS-worthy?

@StanFromIreland

Copy link
Copy Markdown
Member

Also: is this NEWS-worthy?

I don't see a need for one here, I think the docs speak for themselves.

@read-the-docs-community

read-the-docs-community Bot commented Aug 30, 2026

Copy link
Copy Markdown

Documentation build overview

📚 cpython-previews | 🛠️ Build #34302495 | 📁 Comparing fe39fea against main (852381e)

  🔍 Preview build  

8 files changed · + 1 added · ± 7 modified

+ Added

± Modified

Comment thread Doc/tools/templates/indexcontent.html Outdated
Comment thread Doc/library/builtin-index.rst Outdated
Comment thread Doc/library/index.rst
Comment thread Doc/library/builtin-index.rst Outdated

@hugovk hugovk left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shall we name the new Doc/library/builtin-index.rst as Doc/builtins/index.rst instead?

Then instead of:

We get a neater:

This PR can still reference the builtin stuff in their current location, and a followup could move the relevant files and deal with redirects:

  • Doc/library/functions.rst -> Doc/builtins/functions.rst
  • Doc/library/stdtypes.rst -> Doc/builtins/stdtypes.rst
  • Doc/library/constants.rst -> Doc/builtins/constants.rst
  • Doc/library/exceptions.rst -> Doc/builtins/exceptions.rst
  • Doc/library/threadsafety.rst -> Doc/builtins/threadsafety.rst
  • Doc/library/time-complexity.rst -> Doc/builtins/time-complexity.rst

Comment on lines +3 to +5
##################################
Built-in Functions and Classes
##################################

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use sentence case for headers:

https://devguide.python.org/documentation/style-guide/#capitalization

Suggested change
##################################
Built-in Functions and Classes
##################################
##################################
Built-in functions and classes
##################################

But we have more than functions and classes in here, also constants and thread-safety and time-complexity appendices.

Perhaps match what you put on the front page?

Suggested change
##################################
Built-in Functions and Classes
##################################
######################
Built-in reference
######################

And plural?

Suggested change
##################################
Built-in Functions and Classes
##################################
#######################
Built-ins reference
#######################

defines the form of literals and places some constraints on their semantics, but
does not fully define the semantics.

The built-ins also includes functions and exceptions --- objects that can

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
The built-ins also includes functions and exceptions --- objects that can
The built-ins also include functions and exceptions --- objects that can

Comment thread Doc/library/intro.rst
to particular operating systems, such as access to specific hardware; others
provide interfaces that are specific to a particular application domain, like
the World Wide Web. Some modules are available in all versions and ports of
the web development. Some modules are available in all versions and ports of

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
the web development. Some modules are available in all versions and ports of
web development. Some modules are available in all versions and ports of

Comment thread Doc/library/index.rst

While :ref:`reference-index` describes the exact syntax and
semantics of the Python language, this library reference manual
semantics of the Python language, and :ref:`builtin-index` describes

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
semantics of the Python language, and :ref:`builtin-index` describes
semantics of the Python language, and :ref:`builtin-index` describes

Comment thread Doc/library/intro.rst
Comment on lines +29 to 32
and read a section or two. Regardless of the order in which you
read the sections of this manual, it helps to start with chapter
:ref:`built-in-funcs`, as the remainder of the manual assumes familiarity with
this material.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we remove this sentence? The intro already pointed there.

Suggested change
and read a section or two. Regardless of the order in which you
read the sections of this manual, it helps to start with chapter
:ref:`built-in-funcs`, as the remainder of the manual assumes familiarity with
this material.
and read a section or two.

Or update it to something along the lines of?

Suggested change
and read a section or two. Regardless of the order in which you
read the sections of this manual, it helps to start with chapter
:ref:`built-in-funcs`, as the remainder of the manual assumes familiarity with
this material.
and read a section or two. Regardless of the order in which you
read the sections of this manual, it helps to first read
:ref:`built-in-funcs` in :ref:`builtin-index`, as this manual assumes
familiarity with that material.

<span class="linkdescr"> {% trans whatsnew_index=pathto("whatsnew/index") %}Or <a href="{{ whatsnew_index }}">all "What's new" documents since Python 2.0</a>{% endtrans %}</span></li>
<li class="biglink"><a class="biglink" href="{{ pathto("tutorial/index") }}">{% trans %}Tutorial{% endtrans %}</a><br>
<span class="linkdescr">{% trans %}Start here: a tour of Python's syntax and features{% endtrans %}</span></li>
<li class="biglink"><a class="biglink" href="{{ pathto("library/builtin-index") }}">{% trans %}Built-in reference{% endtrans %}</a><br>

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
<li class="biglink"><a class="biglink" href="{{ pathto("library/builtin-index") }}">{% trans %}Built-in reference{% endtrans %}</a><br>
<li class="biglink"><a class="biglink" href="{{ pathto("library/builtin-index") }}">{% trans %}Built-ins reference{% endtrans %}</a><br>


.. We don't use :numbered: option for the TOC below as it enforces
numbered sections for the entire builtin docs. If desired,
:numbered: can be enabled on a per-module basis.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copied from stdlib index, but no modules here.

Suggested change
:numbered: can be enabled on a per-module basis.
:numbered: can be enabled on a per-page basis.


Python comes with a number of built-in functions and classes.

The built-in classes include data types that would normally be considered part of the "core" of a

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: wrap to ~80 cols.

@StanFromIreland StanFromIreland left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also, you need to update the What Now? page in the tutorial.

I concur with Hugo, splitting this into a separate directory would be nicer. We can do redirects at client side (using one of the various Sphinx extensions) or sever side (by configuring them in python/psf-salt).

Comment thread Doc/reference/index.rst
language. It is terse, but attempts to be exact and complete. The semantics of
non-essential built-in object types and of the built-in functions and modules
are described in :ref:`library-index`. For an informal introduction to the
built-in object types and of the built-in functions and modules

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think we should drop "non-essential" what about everything documented in the datamodel?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants