From 32bc1b167cda6dc976f0dd431e8d228eaea40011 Mon Sep 17 00:00:00 2001 From: Terry Jan Reedy Date: Sun, 12 Nov 2023 21:39:41 -0500 Subject: [PATCH 1/4] gh-112007: Reorganize help's intro message Most important: move how-to-quit sentence to the end. --- Lib/pydoc.py | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/Lib/pydoc.py b/Lib/pydoc.py index c9a55799b39f0c..00914c40494628 100755 --- a/Lib/pydoc.py +++ b/Lib/pydoc.py @@ -2074,19 +2074,20 @@ def help(self, request, is_cli=False): def intro(self): self.output.write(''' -Welcome to Python {0}'s help utility! - -If this is your first time using Python, you should definitely check out -the tutorial on the internet at https://docs.python.org/{0}/tutorial/. +Welcome to Python {0}'s help utility! If this is your first time using +Python, you should definitely check out the tutorial on the internet at +https://docs.python.org/{0}/tutorial/. Enter the name of any module, keyword, or topic to get help on writing -Python programs and using Python modules. To quit this help utility and -return to the interpreter, just type "quit". +Python programs and using Python modules. To get a list of available +modules, keywords, symbols, or topics, type "modules", "keywords", +"symbols", or "topics". + +Each module also comes with a one-line summary of what it does; to list +the modules whose name or summary contain a given string such as "spam", +type "modules spam". -To get a list of available modules, keywords, symbols, or topics, type -"modules", "keywords", "symbols", or "topics". Each module also comes -with a one-line summary of what it does; to list the modules whose name -or summary contain a given string such as "spam", type "modules spam". +To quit this help utility and return to the interpreter, just type "quit". '''.format('%d.%d' % sys.version_info[:2])) def list(self, items, columns=4, width=80): From 757f604bf9d60912a334cb1b5bf1e52534b33ab3 Mon Sep 17 00:00:00 2001 From: Terry Jan Reedy Date: Sun, 12 Nov 2023 21:54:52 -0500 Subject: [PATCH 2/4] Mention 'q' as a way to quit. --- Lib/pydoc.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Lib/pydoc.py b/Lib/pydoc.py index 00914c40494628..b5e59f9ae20382 100755 --- a/Lib/pydoc.py +++ b/Lib/pydoc.py @@ -2087,7 +2087,8 @@ def intro(self): the modules whose name or summary contain a given string such as "spam", type "modules spam". -To quit this help utility and return to the interpreter, just type "quit". +To quit this help utility and return to the interpreter, +type "q" or "quit". '''.format('%d.%d' % sys.version_info[:2])) def list(self, items, columns=4, width=80): From a7ef7a4544d13587e00b62694a032ad117540586 Mon Sep 17 00:00:00 2001 From: Terry Jan Reedy Date: Mon, 13 Nov 2023 00:01:04 -0500 Subject: [PATCH 3/4] Replace 'type' with 'enter'. --- Lib/pydoc.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Lib/pydoc.py b/Lib/pydoc.py index b5e59f9ae20382..9fac5862fd661e 100755 --- a/Lib/pydoc.py +++ b/Lib/pydoc.py @@ -2073,22 +2073,22 @@ def help(self, request, is_cli=False): self.output.write('\n') def intro(self): - self.output.write(''' + self.output.write('''\ Welcome to Python {0}'s help utility! If this is your first time using Python, you should definitely check out the tutorial on the internet at https://docs.python.org/{0}/tutorial/. Enter the name of any module, keyword, or topic to get help on writing Python programs and using Python modules. To get a list of available -modules, keywords, symbols, or topics, type "modules", "keywords", +modules, keywords, symbols, or topics, enter "modules", "keywords", "symbols", or "topics". Each module also comes with a one-line summary of what it does; to list the modules whose name or summary contain a given string such as "spam", -type "modules spam". +enter "modules spam". To quit this help utility and return to the interpreter, -type "q" or "quit". +enter "q" or "quit". '''.format('%d.%d' % sys.version_info[:2])) def list(self, items, columns=4, width=80): From 8f52d2ff72312020470ac976dacb5d16cd58b528 Mon Sep 17 00:00:00 2001 From: Terry Jan Reedy Date: Mon, 13 Nov 2023 13:25:30 -0500 Subject: [PATCH 4/4] Remove 'on the internet' Co-authored-by: Hugo van Kemenade --- Lib/pydoc.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Lib/pydoc.py b/Lib/pydoc.py index 9fac5862fd661e..be41592cc64bad 100755 --- a/Lib/pydoc.py +++ b/Lib/pydoc.py @@ -2075,7 +2075,7 @@ def help(self, request, is_cli=False): def intro(self): self.output.write('''\ Welcome to Python {0}'s help utility! If this is your first time using -Python, you should definitely check out the tutorial on the internet at +Python, you should definitely check out the tutorial at https://docs.python.org/{0}/tutorial/. Enter the name of any module, keyword, or topic to get help on writing