FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Docs: split builtins to their own page from library by nedbat · Pull Request #156682 · python/cpython · GitHub

Repository navigation

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

Merged
nedbat merged 20 commits into
python:mainfrom
nedbat:nedbat/split-builtin-stdlib
Sep 13, 2026
Merged

nedbat merged 20 commits into
python:mainfrom
nedbat:nedbat/split-builtin-stdlib

Conversation

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 commented Aug 30, 2026

Copy link
Copy Markdown
Member Author

Also: is this NEWS-worthy?

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 Bot commented Aug 30, 2026 •
edited
Loading

Copy link
Copy Markdown

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 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.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

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 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.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

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 Outdated

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.

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

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.

hugovk commented Sep 1, 2026

Copy link
Copy Markdown
Member

Server-side psf-salt redirects would be better than client-side sphinxext-rediraffe: they work with JavaScript disabled (better for all the scrapers and bots), are faster on server-side (HTTP layer before any HTML fetched), and get cached in the CDN, and better for SEO.

We don't have such server-side control for the devguide, which is hosted on GitHub Pages. (Also I'd say client-side JS redirects are fine for the less-important devguide.)

nedbat commented Sep 1, 2026

Copy link
Copy Markdown
Member Author

That all makes sense. Do we have a way to coordinate the updates to psf-salt with updates to the docs, especially with backports involved?

StanFromIreland commented Sep 1, 2026 •
edited
Loading

Copy link
Copy Markdown
Member

(There's no documented process I'm afraid) You can open a PR there and limit the redirect to specific Python versions. I can review and merge when we land this.

nedbat added the docs Documentation in the Doc dir label Sep 1, 2026
github-project-automation Bot moved this to Todo in Docs PRs Sep 1, 2026
nedbat force-pushed the nedbat/split-builtin-stdlib branch from c6de373 to ea9966e Compare September 1, 2026 17:43

nedbat commented Sep 2, 2026

Copy link
Copy Markdown
Member Author

Moving pages causes the "removed HTML IDs" check to fail. The IDs aren't gone, they are in a different page. Do I still add them to removed-ids.txt?

Copy link
Copy Markdown
Member

Do I still add them to removed-ids.txt?

Yes, see the line with an asyncio file for the required format.

hugovk commented Sep 12, 2026

Copy link
Copy Markdown
Member

Merge in main to fix:

      File "/home/runner/work/cpython/cpython/Doc/venv/lib/python3.14/site-packages/sphinx/builders/changes.py", line 61, in write_documents
        ttext = self.typemap[changeset.type]
                ~~~~~~~~~~~~^^^^^^^^^^^^^^^^
    KeyError: 'soft-deprecated'

nedbat merged commit 59c4bdd into python:main Sep 13, 2026
51 checks passed
github-project-automation Bot moved this from Todo to Done in Docs PRs Sep 13, 2026

Copy link
Copy Markdown

Thanks @nedbat for the PR 🌮🎉.. I'm working now to backport this PR to: 3.13, 3.14, 3.15.
🐍🍒⛏🤖

Copy link
Copy Markdown

Sorry, @nedbat, I could not cleanly backport this to 3.15 due to a conflict.
Please backport using cherry_picker on command line.

cherry_picker 59c4bddb1762b4706c942d6403fb8df470f37e05 3.15

Copy link
Copy Markdown

Sorry, @nedbat, I could not cleanly backport this to 3.14 due to a conflict.
Please backport using cherry_picker on command line.

cherry_picker 59c4bddb1762b4706c942d6403fb8df470f37e05 3.14

Copy link
Copy Markdown

Sorry, @nedbat, I could not cleanly backport this to 3.13 due to a conflict.
Please backport using cherry_picker on command line.

cherry_picker 59c4bddb1762b4706c942d6403fb8df470f37e05 3.13

bedevere-app Bot commented Sep 13, 2026

Copy link
Copy Markdown

GH-157440 is a backport of this pull request to the 3.13 branch.

bedevere-app Bot removed the needs backport to 3.13 only security fixes label Sep 13, 2026

bedevere-app Bot commented Sep 13, 2026

Copy link
Copy Markdown

GH-157441 is a backport of this pull request to the 3.14 branch.

bedevere-app Bot removed the needs backport to 3.14 bugs and security fixes label Sep 13, 2026

bedevere-app Bot commented Sep 13, 2026

Copy link
Copy Markdown

GH-157442 is a backport of this pull request to the 3.15 branch.

bedevere-app Bot removed the needs backport to 3.15 bugs and security fixes label Sep 13, 2026
nedbat added a commit that referenced this pull request Sep 13, 2026
#157440)

* [3.13] Docs: split builtins to their own page from library (GH-156682)

* Docs: split builtins to their own page from library

* review feedback

* addressed Hugo's feedback

* update the What's Next page

* one more wording tweak

* move builtins to their own directory. fix the reference name

* moved pages need to be noted in tools/removed-ids.txt

* add Python to the builtins reference title

* add sphinxext-rediraffe for the library->builtins split

* update check-html-ids to handle rediraffe redirects

* now we don't need (page missing) for the redirected pages

* update other references to moved pages

* A seealso from builtins to library

* make a nice section for rediraffe settings

* move the builtins note to the end, as a seealso

* address merwok's comments

* cache looking for ids in files

* simplify the intro paragraphs
(cherry picked from commit 59c4bdd)

Co-authored-by: Ned Batchelder <ned@nedbatchelder.com>

* remove references to non-existent pages
nedbat added a commit that referenced this pull request Sep 13, 2026
#157441)

* Docs: split builtins to their own page from library

* review feedback

* addressed Hugo's feedback

* update the What's Next page

* one more wording tweak

* move builtins to their own directory. fix the reference name

* moved pages need to be noted in tools/removed-ids.txt

* add Python to the builtins reference title

* add sphinxext-rediraffe for the library->builtins split

* update check-html-ids to handle rediraffe redirects

* now we don't need (page missing) for the redirected pages

* update other references to moved pages

* A seealso from builtins to library

* make a nice section for rediraffe settings

* move the builtins note to the end, as a seealso

* address merwok's comments

* cache looking for ids in files

* simplify the intro paragraphs
(cherry picked from commit 59c4bdd)

nedbat commented Sep 13, 2026

Copy link
Copy Markdown
Member Author

I've added server-side redirects in python/psf-salt#651.

nedbat deleted the nedbat/split-builtin-stdlib branch September 13, 2026 17:43
johnslavik pushed a commit to johnslavik/cpython that referenced this pull request Sep 14, 2026
* Docs: split builtins to their own page from library

* review feedback

* addressed Hugo's feedback

* update the What's Next page

* one more wording tweak

* move builtins to their own directory. fix the reference name

* moved pages need to be noted in tools/removed-ids.txt

* add Python to the builtins reference title

* add sphinxext-rediraffe for the library->builtins split

* update check-html-ids to handle rediraffe redirects

* now we don't need (page missing) for the redirected pages

* update other references to moved pages

* A seealso from builtins to library

* make a nice section for rediraffe settings

* move the builtins note to the end, as a seealso

* address merwok's comments

* cache looking for ids in files

* simplify the intro paragraphs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

docs Documentation in the Doc dir skip issue skip news

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

6 participants


Back | FazBrowse Home | New Git URL