This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author terry.reedy
Recipients Ramchandra Apte, orsenthil, terry.reedy
Date 2013-02-11.03:13:16
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1360552397.17.0.190055993287.issue17158@psf.upfronthosting.co.za>
In-reply-to
Content
Looking further at the pydoc code, I see that "Here is a list. Enter any listed item to get more help", with both sentences printed before the list, is normal. Having a post-list prompt for the list of all modules is the exception. So I would no longer make the change proposed in my first patch and would instead look to rewording along the line Senthil suggested.

listmodules(key) calls apropos(key) after printing the header. That function in turn creates a ModuleScanner and calls .run with a callback. So making the prompt conditional on whether or not anything is found would require modification of ModuleScanner.run(), apropos(), and listscanner(). As indicated by my first patch, I agree with Senthil that it is not worth the effort when a better prompt should do.

A deeper problem is this: the prompt "Enter any listed item to get more help." is only valid if one asks for the list in help mode, at the "help> " prompt. If one asks for the list at the normal interpreter ">>> " prompt with "help('xxx')", as described in the original post, then entering the name of the listed item at the next ">>> " prompt is wrong. One should instead wrap the text with "help('" and "')", or enter help() mode first. However, I have not yet discovered a way to detect the context of the list request so that the prompt could be modified.

The Welcome text could also use a couple of changes.
1. It does not mention the new symbol help.
"To get a list of available modules, keywords, or topics, type "modules", "keywords", or "topics".
should include symbols and "symbols".
2. This: '''to list the modules whose summaries contain a given word
such as "spam",'''
is more accurately written as this:
'''to list the modules whose name or summary contain a
given string such as "spam",'''

Attached is a second patch with the easy fixes, without touching the context-prompt issue.

A possible commit message: Add 'symbols' to help welcome message; clarify 'modules spam' messages.
History
Date User Action Args
2013-02-11 03:13:17terry.reedysetrecipients: + terry.reedy, orsenthil, Ramchandra Apte
2013-02-11 03:13:17terry.reedysetmessageid: <1360552397.17.0.190055993287.issue17158@psf.upfronthosting.co.za>
2013-02-11 03:13:17terry.reedylinkissue17158 messages
2013-02-11 03:13:16terry.reedycreate