Skip to content

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

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

Docs: split builtins to their own page from library#156682
nedbat wants to merge 5 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 #34316866 | 📁 Comparing 7bcbd5e against main (852381e)

  🔍 Preview build  

14 files changed · + 1 added · ± 13 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 thread Doc/library/builtin-index.rst Outdated
Comment thread Doc/library/builtin-index.rst Outdated
Comment thread Doc/library/intro.rst Outdated
Comment thread Doc/library/index.rst Outdated
Comment thread Doc/library/intro.rst Outdated
Comment thread Doc/tools/templates/indexcontent.html Outdated
Comment thread Doc/library/builtin-index.rst Outdated
Comment thread Doc/library/builtin-index.rst Outdated

@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?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

I didn't see what the word "non-essential" was adding here. Which built-in object types are non-essential?

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.

Types like range, which aren't documented in the Data model.

@nedbat

nedbat commented Aug 31, 2026

Copy link
Copy Markdown
Member Author

I can do the renames and redirects.

We can do redirects at client side (using one of the various Sphinx extensions) or sever side (by configuring them in python/psf-salt).

What Sphinx extension have we used for redirects before? I see https://github.com/python/psf-salt/blob/main/salt/docs/config/nginx.docs-redirects.conf for the psf-salt approach.

@StanFromIreland

Copy link
Copy Markdown
Member

What Sphinx extension have we used for redirects before?

We use sphinxext-rediraffe in the Devguide, it generates stubs with some JS to redirect to the new page.

@nedbat

nedbat commented Aug 31, 2026

Copy link
Copy Markdown
Member Author

What Sphinx extension have we used for redirects before?

We use sphinxext-rediraffe in the Devguide, it generates stubs with some JS to redirect to the new page.

I knew rediraffe was somewhere! Is there a reason we don't want to introduce it for the main docs?

@StanFromIreland

Copy link
Copy Markdown
Member

Is there a reason we don't want to introduce it for the main docs?

I presume it's simply because there hasn't really been a need so far. We're less keen to move pages here than in the Devguide. IIRC rediraffe requires JS, but that ship has sailed anyway.

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