Title: gh-94466: Improve 'help' message in interactive pydoc by Jah-yee · Pull Request #148863 · python/cpython · GitHub
Open Graph Title: gh-94466: Improve 'help' message in interactive pydoc by Jah-yee · Pull Request #148863 · python/cpython
X Title: gh-94466: Improve 'help' message in interactive pydoc by Jah-yee · Pull Request #148863 · python/cpython
Description: Good day Summary This PR fixes issue #94466, which reports an invalid help message when using help(help) inside the interactive help utility. The Problem When a user is at the help> prompt and types something like help(help), the error message displayed says: Use help() to get the interactive help utility. However, at the help> prompt, typing help() would exit the interactive help and return to the Python interpreter. The correct command to redisplay the intro is simply help (without parentheses). The Fix Changed the error message from: Use help() to get the interactive help utility. to: Use 'help' to get the interactive help utility. This makes the message consistent with the actual behavior - typing help at the help> prompt calls self.intro() as expected (line 2041 in pydoc.py). Testing The fix was verified by examining the code path: User at help> prompt types help(help) Helper.help() is called (line 2054) with request='help(help)' The string doesn't match any special case, so doc(request, ...) is called doc() calls render_doc() which calls resolve('help(help)', ...) locate() can't find help(help) as a module/path, returns None ImportError is raised with the improved message Files Changed Lib/pydoc.py: Changed one line in the resolve() function's error message Thank you for your attention. If there are any issues or suggestions, please leave a comment and I will address them promptly. Warmly, Jah-yee Issue: gh-94466
Open Graph Description: Good day Summary This PR fixes issue #94466, which reports an invalid help message when using help(help) inside the interactive help utility. The Problem When a user is at the help> prompt and t...
X Description: Good day Summary This PR fixes issue #94466, which reports an invalid help message when using help(help) inside the interactive help utility. The Problem When a user is at the help> prompt a...
Opengraph URL: https://github.com/python/cpython/pull/148863
X: @github
Domain: github.com
| route-pattern | /:user_id/:repository/pull/:id/files(.:format) |
| route-controller | pull_requests |
| route-action | files |
| fetch-nonce | v2:93177c6e-e606-5ae6-7424-b86c47d960e1 |
| current-catalog-service-hash | ae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b |
| request-id | A4C6:370C10:C73A45:110CD63:6A55BE65 |
| html-safe-nonce | 6b6fd158c26a80b1e5fae5c904b45d13182d7050d217de83e0014b34a93c389f |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBNEM2OjM3MEMxMDpDNzNBNDU6MTEwQ0Q2Mzo2QTU1QkU2NSIsInZpc2l0b3JfaWQiOiI3NTI4ODgyOTcyMjE0NTQxOTI1IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | 1ae8f987403d1315bb4c069a6a7a953c8411df15ea84b02bbda7cdf12b40f456 |
| hovercard-subject-tag | pull_request:3564819726 |
| 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/148863/files |
| twitter:image | https://avatars.githubusercontent.com/u/166608075?s=400&v=4 |
| twitter:card | summary_large_image |
| og:image | https://avatars.githubusercontent.com/u/166608075?s=400&v=4 |
| og:image:alt | Good day Summary This PR fixes issue #94466, which reports an invalid help message when using help(help) inside the interactive help utility. The Problem When a user is at the help> prompt and t... |
| og:site_name | GitHub |
| og:type | object |
| hostname | github.com |
| expected-hostname | github.com |
| None | b5665c84831ed9ac4fb79519c16c9c5580ba8092fb8bb6e3e72972ec7197348e |
| 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 full-width |
| disable-turbo | true |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 64b9ae238e18eb87ead1f9fe37a7cc81d67d85aa |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width