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...
Opengraph URL: https://github.com/python/cpython/pull/138268
X: @github
Domain: github.com
| route-pattern | /:user_id/:repository/pull/:id/commits/:range(.:format) |
| route-controller | pull_requests |
| route-action | commits |
| fetch-nonce | v2:01139dba-f69c-b9a9-b132-61b19ce4697b |
| current-catalog-service-hash | ae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b |
| request-id | B5B6:127E22:537BE3D:705F721:6995BCB1 |
| html-safe-nonce | 2d63bbdccaaf73498671d5ad68d7a8ded58a00e7d400028c0bd7fdeee93d9951 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCNUI2OjEyN0UyMjo1MzdCRTNEOjcwNUY3MjE6Njk5NUJDQjEiLCJ2aXNpdG9yX2lkIjoiMjk4MzY2NzgyNjE1MjU1MzY0OSIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 719dec6555e0598e5badc2003ebc9b4668584d1066e24751c9872e4d7d27fcdb |
| hovercard-subject-tag | pull_request:2786946291 |
| github-keyboard-shortcuts | repository,pull-request-list,pull-request-conversation,pull-request-files-changed,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/python/cpython/pull/138268/commits/6f38649d043b56e871411f2a6065afcb26e192e1 |
| twitter:image | https://avatars.githubusercontent.com/u/62268282?s=400&v=4 |
| twitter:card | summary_large_image |
| og:image | https://avatars.githubusercontent.com/u/62268282?s=400&v=4 |
| og:image:alt | 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 ... |
| og:site_name | GitHub |
| og:type | object |
| hostname | github.com |
| expected-hostname | github.com |
| None | db6e0566cb0ff9d4d5e42a9ea092b295227443ff414c53098b551c8f31721145 |
| turbo-cache-control | no-preview |
| diff-view | unified |
| go-import | github.com/python/cpython git https://github.com/python/cpython.git |
| octolytics-dimension-user_id | 1525981 |
| octolytics-dimension-user_login | python |
| octolytics-dimension-repository_id | 81598961 |
| octolytics-dimension-repository_nwo | python/cpython |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 81598961 |
| octolytics-dimension-repository_network_root_nwo | python/cpython |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 672486f3337737e98e5438ff6dc46c49119d654a |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width