René's URL Explorer Experiment


Title: gh-69605: Hardcode some stdlib submodules in PyREPL module completion (os.path, collections.abc...) by loic-simon · Pull Request #138268 · python/cpython · GitHub

Open Graph Title: gh-69605: Hardcode some stdlib submodules in PyREPL module completion (os.path, collections.abc...) by loic-simon · Pull Request #138268 · python/cpython

X Title: gh-69605: Hardcode some stdlib submodules in PyREPL module completion (os.path, collections.abc...) by loic-simon · Pull Request #138268 · python/cpython

Description: From #69605 (comment): This is expected, collections.abc is not a real module, same for os.path so pkgutil won't find it. One thing we could do is hardcode these modules but I haven't had the time to look into it. This PR adds a hardcoded dictionary of unusual standard library submodules that pkgutil.iter_modules can't find despite them being importable, so we can suggest them anyway. The hardcoded dictionary comes from checking all documented modules to find which submodules _pyrepl._module_completer.ModuleCompleter was unable to detect. I wrote a test to ensure all hardcoded modules are indeed importable, but I'm not sure we can programatically detect eventual new modules so we don't forget to add them, but it should be rare enough to not be too much a concern. cc @tomasr8 Issue: gh-69605

Open Graph Description: From #69605 (comment): This is expected, collections.abc is not a real module, same for os.path so pkgutil won't find it. One thing we could do is hardcode these modules but I haven't had ...

X Description: From #69605 (comment): This is expected, collections.abc is not a real module, same for os.path so pkgutil won't find it. One thing we could do is hardcode these modules but I haven&#3...

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

X: @github

direct link

Domain: github.com

route-pattern/:user_id/:repository/pull/:id/commits/:range(.:format)
route-controllerpull_requests
route-actioncommits
fetch-noncev2:01139dba-f69c-b9a9-b132-61b19ce4697b
current-catalog-service-hashae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b
request-idB5B6:127E22:537BE3D:705F721:6995BCB1
html-safe-nonce2d63bbdccaaf73498671d5ad68d7a8ded58a00e7d400028c0bd7fdeee93d9951
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCNUI2OjEyN0UyMjo1MzdCRTNEOjcwNUY3MjE6Njk5NUJDQjEiLCJ2aXNpdG9yX2lkIjoiMjk4MzY2NzgyNjE1MjU1MzY0OSIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9
visitor-hmac719dec6555e0598e5badc2003ebc9b4668584d1066e24751c9872e4d7d27fcdb
hovercard-subject-tagpull_request:2786946291
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/138268/commits/6f38649d043b56e871411f2a6065afcb26e192e1
twitter:imagehttps://avatars.githubusercontent.com/u/62268282?s=400&v=4
twitter:cardsummary_large_image
og:imagehttps://avatars.githubusercontent.com/u/62268282?s=400&v=4
og:image:altFrom #69605 (comment): This is expected, collections.abc is not a real module, same for os.path so pkgutil won't find it. One thing we could do is hardcode these modules but I haven't had ...
og:site_nameGitHub
og:typeobject
hostnamegithub.com
expected-hostnamegithub.com
Nonedb6e0566cb0ff9d4d5e42a9ea092b295227443ff414c53098b551c8f31721145
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
release672486f3337737e98e5438ff6dc46c49119d654a
ui-targetfull
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://github.com/python/cpython/pull/138268/commits/6f38649d043b56e871411f2a6065afcb26e192e1#start-of-content
https://github.com/
Sign in https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fpython%2Fcpython%2Fpull%2F138268%2Fcommits%2F6f38649d043b56e871411f2a6065afcb26e192e1
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%2F138268%2Fcommits%2F6f38649d043b56e871411f2a6065afcb26e192e1
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/138268/commits/6f38649d043b56e871411f2a6065afcb26e192e1
Reloadhttps://github.com/python/cpython/pull/138268/commits/6f38649d043b56e871411f2a6065afcb26e192e1
Reloadhttps://github.com/python/cpython/pull/138268/commits/6f38649d043b56e871411f2a6065afcb26e192e1
python https://github.com/python
cpythonhttps://github.com/python/cpython
Please reload this pagehttps://github.com/python/cpython/pull/138268/commits/6f38649d043b56e871411f2a6065afcb26e192e1
Notifications https://github.com/login?return_to=%2Fpython%2Fcpython
Fork 34.1k https://github.com/login?return_to=%2Fpython%2Fcpython
Star 71.5k 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
ambvhttps://github.com/ambv
python:mainhttps://github.com/python/cpython/tree/main
loic-simon:pyrepl-module-completion-hardcode-special-stdlib-submoduleshttps://github.com/loic-simon/cpython/tree/pyrepl-module-completion-hardcode-special-stdlib-submodules
Conversation 11 https://github.com/python/cpython/pull/138268
Commits 6 https://github.com/python/cpython/pull/138268/commits
Checks 55 https://github.com/python/cpython/pull/138268/checks
Files changed https://github.com/python/cpython/pull/138268/files
Please reload this pagehttps://github.com/python/cpython/pull/138268/commits/6f38649d043b56e871411f2a6065afcb26e192e1
gh-69605: Hardcode some stdlib submodules in PyREPL module completion (os.path, collections.abc...) https://github.com/python/cpython/pull/138268/commits/6f38649d043b56e871411f2a6065afcb26e192e1#top
Show all changes 6 commits https://github.com/python/cpython/pull/138268/files
dc13676 PyREPL module completion: hardcode special stdlib submodules loic-simon Aug 30, 2025 https://github.com/python/cpython/pull/138268/commits/dc136768180506c5823c5ecc1dbaabee81f77fd7
6f38649 📜🤖 Added by blurb_it. blurb-it[bot] Aug 30, 2025 https://github.com/python/cpython/pull/138268/commits/6f38649d043b56e871411f2a6065afcb26e192e1
362e821 Review feedback loic-simon Aug 30, 2025 https://github.com/python/cpython/pull/138268/commits/362e821a816a7843990f328677f0d08494e72892
a952c2a Use .extend instead of + loic-simon Aug 30, 2025 https://github.com/python/cpython/pull/138268/commits/a952c2a6c8d589dd1e0af2cc11d3fecd001b807a
fbfe884 Do not propose hardcoded submodules if local import loic-simon Aug 31, 2025 https://github.com/python/cpython/pull/138268/commits/fbfe884e66a79de1df33768836a6632b044da991
985bb20 Nit nittety nit ambv Sep 15, 2025 https://github.com/python/cpython/pull/138268/commits/985bb20b459dc7ebc69bf421e66cdc787118a74a
Clear filters https://github.com/python/cpython/pull/138268/commits/6f38649d043b56e871411f2a6065afcb26e192e1
Please reload this pagehttps://github.com/python/cpython/pull/138268/commits/6f38649d043b56e871411f2a6065afcb26e192e1
Please reload this pagehttps://github.com/python/cpython/pull/138268/commits/6f38649d043b56e871411f2a6065afcb26e192e1
Prev https://github.com/python/cpython/pull/138268/commits/dc136768180506c5823c5ecc1dbaabee81f77fd7
Next https://github.com/python/cpython/pull/138268/commits/362e821a816a7843990f328677f0d08494e72892
Please reload this pagehttps://github.com/python/cpython/pull/138268/commits/6f38649d043b56e871411f2a6065afcb26e192e1
https://github.com/apps/blurb-it
blurb-it[bot]https://github.com/python/cpython/commits?author=blurb-it%5Bbot%5D
Misc/NEWS.d/next/Core_and_Builtins/2025-08-30-17-15-05.gh-issue-69605.KjBk99.rsthttps://github.com/python/cpython/pull/138268/commits/6f38649d043b56e871411f2a6065afcb26e192e1#diff-7fdf63f53b3b7652b261fea5f59627c4918fa1a599eab89b4c2f961322c5b7e2
View file https://github.com/loic-simon/cpython/blob/6f38649d043b56e871411f2a6065afcb26e192e1/Misc/NEWS.d/next/Core_and_Builtins/2025-08-30-17-15-05.gh-issue-69605.KjBk99.rst
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/python/cpython/pull/138268/commits/{{ revealButtonHref }}
Please reload this pagehttps://github.com/python/cpython/pull/138268/commits/6f38649d043b56e871411f2a6065afcb26e192e1
Please reload this pagehttps://github.com/python/cpython/pull/138268/commits/6f38649d043b56e871411f2a6065afcb26e192e1
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.