René's URL Explorer Experiment


Title: GH-121970: Extract ``pydoc_topics`` into a new extension by AA-Turner · Pull Request #129116 · python/cpython · GitHub

Open Graph Title: GH-121970: Extract ``pydoc_topics`` into a new extension by AA-Turner · Pull Request #129116 · python/cpython

X Title: GH-121970: Extract ``pydoc_topics`` into a new extension by AA-Turner · Pull Request #129116 · python/cpython

Description: This also simplifies the pydoc-topics builder. Grouping the topic labels by docname improves the speed of topics generation from ~68s to ~57s (19% faster) from a cold state, and from ~13s to ~3.4s (3.8x faster) when re-using the pickled documents. The representation of topics.py also changes from the default pprint.pformat output of: topics = {'assert': 'The "assert" statement\n' '**********************\n' '\n' 'Assert statements are a convenient way to insert debugging ' 'assertions\n' 'into a program:\n' to a simpler representation using triple single quotes (save for when ''' appears in the body): topics = { 'assert': r'''The "assert" statement ********************** Assert statements are a convenient way to insert debugging assertions into a program: ''' This representation is both nicer to read and is 63% of the file size of the current topics.py (518KB vs 830KB). Line count also decreases from 17,486 to 12,782. Tested by running: >>> import runpy >>> topics_old = runpy.run_path("Doc/build/topics_old.py")['topics'] >>> topics_new = runpy.run_path("Doc/build/topics_new.py")['topics'] >>> assert list(topics_old) == list(topics_new) # check order >>> [k for k in topics_old if topics_old[k] != topics_new[k]] ['debugger', 'formatstrings'] The 'formatstrings' change is trailing whitespace on the >>> for num in range(5,12): line: >>> fs_old_stripped = '\n'.join(map(str.rstrip, topics_old['formatstrings'].splitlines())) >>> fs_new_stripped = '\n'.join(map(str.rstrip, topics_new['formatstrings'].splitlines())) >>> assert fs_old_stripped == fs_new_stripped The 'debugger' change is "Ctrl-C" to "Ctrl"-"C", but I'm not sure what caused this: >>> print('\n'.join(difflib.unified_diff(topics_old['debugger'].splitlines(), topics_new['debugger'].splitlines()))) --- +++ @@ -186,9 +186,9 @@ originate in a module that matches one of these patterns. [1] By default, Pdb sets a handler for the SIGINT signal (which is sent - when the user presses "Ctrl-C" on the console) when you give a + when the user presses "Ctrl"-"C" on the console) when you give a "continue" command. This allows you to break into the debugger - again by pressing "Ctrl-C". If you want Pdb not to touch the + again by pressing "Ctrl"-"C". If you want Pdb not to touch the SIGINT handler, set *nosigint* to true. cc @hugovk as 3.14 release manager as this does change the format of Lib/pydoc_data/topics.py. I'm happy when doing backports to preserve the current format (pformat) if release managers would prefer. A Issue: gh-121970 📚 Documentation preview 📚: https://cpython-previews--129116.org.readthedocs.build/

Open Graph Description: This also simplifies the pydoc-topics builder. Grouping the topic labels by docname improves the speed of topics generation from ~68s to ~57s (19% faster) from a cold state, and from ~13s to ~3.4s ...

X Description: This also simplifies the pydoc-topics builder. Grouping the topic labels by docname improves the speed of topics generation from ~68s to ~57s (19% faster) from a cold state, and from ~13s to ~3.4s ...

Opengraph URL: https://github.com/python/cpython/pull/129116

X: @github

direct link

Domain: github.com

route-pattern/:user_id/:repository/pull/:id/commits/:range(.:format)
route-controllerpull_requests
route-actioncommits
fetch-noncev2:6172a684-c88a-fd01-f6ac-13efe76ef030
current-catalog-service-hashae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b
request-idE76A:239779:7360FE3:9C88B36:69960007
html-safe-noncee9b5cb39799e1228e01279c316b547fd76f38e14c29c2bd9e1bc0667d99b722f
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJFNzZBOjIzOTc3OTo3MzYwRkUzOjlDODhCMzY6Njk5NjAwMDciLCJ2aXNpdG9yX2lkIjoiNDA0MTUwNTA3MjcyMjg3MDI3OSIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9
visitor-hmac19b1dcb511ff9ceefb529dc5a0b8d8ef2be15fa6fc8a62fcbe1f665184744911
hovercard-subject-tagpull_request:2288898150
github-keyboard-shortcutsrepository,pull-request-list,pull-request-conversation,pull-request-files-changed,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///pull_requests/show/commits
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/python/cpython/pull/129116/commits/1d278ae35abbb2b0d7bd559bc1027858a6b5bff7
twitter:imagehttps://avatars.githubusercontent.com/u/9087854?s=400&v=4
twitter:cardsummary_large_image
og:imagehttps://avatars.githubusercontent.com/u/9087854?s=400&v=4
og:image:altThis also simplifies the pydoc-topics builder. Grouping the topic labels by docname improves the speed of topics generation from ~68s to ~57s (19% faster) from a cold state, and from ~13s to ~3.4s ...
og:site_nameGitHub
og:typeobject
hostnamegithub.com
expected-hostnamegithub.com
None7490a2fd98baca866acf503b81aa249491b42e5b4bab7f7a2801be81175c8845
turbo-cache-controlno-preview
diff-viewunified
go-importgithub.com/python/cpython git https://github.com/python/cpython.git
octolytics-dimension-user_id1525981
octolytics-dimension-user_loginpython
octolytics-dimension-repository_id81598961
octolytics-dimension-repository_nwopython/cpython
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id81598961
octolytics-dimension-repository_network_root_nwopython/cpython
turbo-body-classeslogged-out env-production page-responsive
disable-turbofalse
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
release5814362c11fe63ca811caa7c470897ee2b3e593e
ui-targetcanary-1
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://github.com/python/cpython/pull/129116/commits/1d278ae35abbb2b0d7bd559bc1027858a6b5bff7#start-of-content
https://github.com/
Sign in https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fpython%2Fcpython%2Fpull%2F129116%2Fcommits%2F1d278ae35abbb2b0d7bd559bc1027858a6b5bff7
GitHub CopilotWrite better code with AIhttps://github.com/features/copilot
GitHub SparkBuild and deploy intelligent appshttps://github.com/features/spark
GitHub ModelsManage and compare promptshttps://github.com/features/models
MCP RegistryNewIntegrate external toolshttps://github.com/mcp
ActionsAutomate any workflowhttps://github.com/features/actions
CodespacesInstant dev environmentshttps://github.com/features/codespaces
IssuesPlan and track workhttps://github.com/features/issues
Code ReviewManage code changeshttps://github.com/features/code-review
GitHub Advanced SecurityFind and fix vulnerabilitieshttps://github.com/security/advanced-security
Code securitySecure your code as you buildhttps://github.com/security/advanced-security/code-security
Secret protectionStop leaks before they starthttps://github.com/security/advanced-security/secret-protection
Why GitHubhttps://github.com/why-github
Documentationhttps://docs.github.com
Bloghttps://github.blog
Changeloghttps://github.blog/changelog
Marketplacehttps://github.com/marketplace
View all featureshttps://github.com/features
Enterpriseshttps://github.com/enterprise
Small and medium teamshttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
App Modernizationhttps://github.com/solutions/use-case/app-modernization
DevSecOpshttps://github.com/solutions/use-case/devsecops
DevOpshttps://github.com/solutions/use-case/devops
CI/CDhttps://github.com/solutions/use-case/ci-cd
View all use caseshttps://github.com/solutions/use-case
Healthcarehttps://github.com/solutions/industry/healthcare
Financial serviceshttps://github.com/solutions/industry/financial-services
Manufacturinghttps://github.com/solutions/industry/manufacturing
Governmenthttps://github.com/solutions/industry/government
View all industrieshttps://github.com/solutions/industry
View all solutionshttps://github.com/solutions
AIhttps://github.com/resources/articles?topic=ai
Software Developmenthttps://github.com/resources/articles?topic=software-development
DevOpshttps://github.com/resources/articles?topic=devops
Securityhttps://github.com/resources/articles?topic=security
View all topicshttps://github.com/resources/articles
Customer storieshttps://github.com/customer-stories
Events & webinarshttps://github.com/resources/events
Ebooks & reportshttps://github.com/resources/whitepapers
Business insightshttps://github.com/solutions/executive-insights
GitHub Skillshttps://skills.github.com
Documentationhttps://docs.github.com
Customer supporthttps://support.github.com
Community forumhttps://github.com/orgs/community/discussions
Trust centerhttps://github.com/trust-center
Partnershttps://github.com/partners
GitHub SponsorsFund open source developershttps://github.com/sponsors
Security Labhttps://securitylab.github.com
Maintainer Communityhttps://maintainers.github.com
Acceleratorhttps://github.com/accelerator
Archive Programhttps://archiveprogram.github.com
Topicshttps://github.com/topics
Trendinghttps://github.com/trending
Collectionshttps://github.com/collections
Enterprise platformAI-powered developer platformhttps://github.com/enterprise
GitHub Advanced SecurityEnterprise-grade security featureshttps://github.com/security/advanced-security
Copilot for BusinessEnterprise-grade AI featureshttps://github.com/features/copilot/copilot-business
Premium SupportEnterprise-grade 24/7 supporthttps://github.com/premium-support
Pricinghttps://github.com/pricing
Search syntax tipshttps://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax
documentationhttps://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax
Sign in https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fpython%2Fcpython%2Fpull%2F129116%2Fcommits%2F1d278ae35abbb2b0d7bd559bc1027858a6b5bff7
Sign up https://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fpull_requests%2Fshow%2Fcommits&source=header-repo&source_repo=python%2Fcpython
Reloadhttps://github.com/python/cpython/pull/129116/commits/1d278ae35abbb2b0d7bd559bc1027858a6b5bff7
Reloadhttps://github.com/python/cpython/pull/129116/commits/1d278ae35abbb2b0d7bd559bc1027858a6b5bff7
Reloadhttps://github.com/python/cpython/pull/129116/commits/1d278ae35abbb2b0d7bd559bc1027858a6b5bff7
python https://github.com/python
cpythonhttps://github.com/python/cpython
Please reload this pagehttps://github.com/python/cpython/pull/129116/commits/1d278ae35abbb2b0d7bd559bc1027858a6b5bff7
Notifications https://github.com/login?return_to=%2Fpython%2Fcpython
Fork 34.1k https://github.com/login?return_to=%2Fpython%2Fcpython
Star 71.6k https://github.com/login?return_to=%2Fpython%2Fcpython
Code https://github.com/python/cpython
Issues 5k+ https://github.com/python/cpython/issues
Pull requests 2.1k https://github.com/python/cpython/pulls
Actions https://github.com/python/cpython/actions
Projects 31 https://github.com/python/cpython/projects
Security 0 https://github.com/python/cpython/security
Insights https://github.com/python/cpython/pulse
Code https://github.com/python/cpython
Issues https://github.com/python/cpython/issues
Pull requests https://github.com/python/cpython/pulls
Actions https://github.com/python/cpython/actions
Projects https://github.com/python/cpython/projects
Security https://github.com/python/cpython/security
Insights https://github.com/python/cpython/pulse
Sign up for GitHub https://github.com/signup?return_to=%2Fpython%2Fcpython%2Fissues%2Fnew%2Fchoose
terms of servicehttps://docs.github.com/terms
privacy statementhttps://docs.github.com/privacy
Sign inhttps://github.com/login?return_to=%2Fpython%2Fcpython%2Fissues%2Fnew%2Fchoose
AA-Turnerhttps://github.com/AA-Turner
python:mainhttps://github.com/python/cpython/tree/main
AA-Turner:docs/pydoc-topicshttps://github.com/AA-Turner/cpython/tree/docs/pydoc-topics
Conversation 11 https://github.com/python/cpython/pull/129116
Commits 8 https://github.com/python/cpython/pull/129116/commits
Checks 55 https://github.com/python/cpython/pull/129116/checks
Files changed https://github.com/python/cpython/pull/129116/files
Please reload this pagehttps://github.com/python/cpython/pull/129116/commits/1d278ae35abbb2b0d7bd559bc1027858a6b5bff7
GH-121970: Extract pydoc_topics into a new extension https://github.com/python/cpython/pull/129116/commits/1d278ae35abbb2b0d7bd559bc1027858a6b5bff7#top
Show all changes 8 commits https://github.com/python/cpython/pull/129116/files
192eac8 Extract ``pydoc_topics`` into a new extension AA-Turner Jan 21, 2025 https://github.com/python/cpython/pull/129116/commits/192eac80b2658c48f686d12e117ce27412e4e0bb
d44ad65 Initial refactor (format, lint, type annotations, pathlib) AA-Turner Jan 21, 2025 https://github.com/python/cpython/pull/129116/commits/d44ad6591fe1593d7936dbe33a9d1c7e6a496ab1
c78578b Second stage refactor AA-Turner Jan 21, 2025 https://github.com/python/cpython/pull/129116/commits/c78578bcdbe57415dc92ee6d6acd86271dd0a74e
fe0a5dc Third stage refactor (use TextTranslator directly) AA-Turner Jan 21, 2025 https://github.com/python/cpython/pull/129116/commits/fe0a5dca567ddd62e325cdd993ae64c1f2ef48ed
371755d Fourth stage refactor (aggregate documents) AA-Turner Jan 21, 2025 https://github.com/python/cpython/pull/129116/commits/371755dd68c160984ef7a390ff4666251e216210
e27c60a double quotes AA-Turner Jan 21, 2025 https://github.com/python/cpython/pull/129116/commits/e27c60a562e39586ccd07c0d7b68a41143ac58ac
1d278ae Use a triple single quote representation AA-Turner Jan 21, 2025 https://github.com/python/cpython/pull/129116/commits/1d278ae35abbb2b0d7bd559bc1027858a6b5bff7
5ac0ac4 Update ``Lib/pydoc_data/topics.py`` AA-Turner Jan 21, 2025 https://github.com/python/cpython/pull/129116/commits/5ac0ac4713bddf3d18ca11b539b9aaaeba018863
Clear filters https://github.com/python/cpython/pull/129116/commits/1d278ae35abbb2b0d7bd559bc1027858a6b5bff7
Please reload this pagehttps://github.com/python/cpython/pull/129116/commits/1d278ae35abbb2b0d7bd559bc1027858a6b5bff7
Please reload this pagehttps://github.com/python/cpython/pull/129116/commits/1d278ae35abbb2b0d7bd559bc1027858a6b5bff7
Prev https://github.com/python/cpython/pull/129116/commits/e27c60a562e39586ccd07c0d7b68a41143ac58ac
Next https://github.com/python/cpython/pull/129116/commits/5ac0ac4713bddf3d18ca11b539b9aaaeba018863
Please reload this pagehttps://github.com/python/cpython/pull/129116/commits/1d278ae35abbb2b0d7bd559bc1027858a6b5bff7
https://github.com/AA-Turner
AA-Turnerhttps://github.com/python/cpython/commits?author=AA-Turner
https://github.com/python/cpython/blob/main/.github/CODEOWNERS#L107
Doc/tools/extensions/pydoc_topics.pyhttps://github.com/python/cpython/pull/129116/commits/1d278ae35abbb2b0d7bd559bc1027858a6b5bff7#diff-991640f6ad51ceb4ab3c773bf6c28521ec1c67d0e054c41c3d107792ffaedf6c
View file https://github.com/AA-Turner/cpython/blob/1d278ae35abbb2b0d7bd559bc1027858a6b5bff7/Doc/tools/extensions/pydoc_topics.py
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/python/cpython/pull/129116/commits/{{ revealButtonHref }}
https://github.com/python/cpython/pull/129116/commits/1d278ae35abbb2b0d7bd559bc1027858a6b5bff7#diff-991640f6ad51ceb4ab3c773bf6c28521ec1c67d0e054c41c3d107792ffaedf6c
https://github.com/python/cpython/pull/129116/commits/1d278ae35abbb2b0d7bd559bc1027858a6b5bff7#diff-991640f6ad51ceb4ab3c773bf6c28521ec1c67d0e054c41c3d107792ffaedf6c
https://github.com/python/cpython/pull/129116/commits/1d278ae35abbb2b0d7bd559bc1027858a6b5bff7#diff-991640f6ad51ceb4ab3c773bf6c28521ec1c67d0e054c41c3d107792ffaedf6c
https://github.com/python/cpython/pull/129116/commits/1d278ae35abbb2b0d7bd559bc1027858a6b5bff7#diff-991640f6ad51ceb4ab3c773bf6c28521ec1c67d0e054c41c3d107792ffaedf6c
https://github.com/python/cpython/pull/129116/commits/1d278ae35abbb2b0d7bd559bc1027858a6b5bff7#diff-991640f6ad51ceb4ab3c773bf6c28521ec1c67d0e054c41c3d107792ffaedf6c
https://github.com
Termshttps://docs.github.com/site-policy/github-terms/github-terms-of-service
Privacyhttps://docs.github.com/site-policy/privacy-policies/github-privacy-statement
Securityhttps://github.com/security
Statushttps://www.githubstatus.com/
Communityhttps://github.community/
Docshttps://docs.github.com/
Contacthttps://support.github.com?tags=dotcom-footer

Viewport: width=device-width


URLs of crawlers that visited me.