Skip to content

Commit 3d050dd

Browse files
committed
#9364: Improve the text printed by help(pydoc) and help(help).
1 parent 658af31 commit 3d050dd

File tree

2 files changed

+9
-4
lines changed

2 files changed

+9
-4
lines changed

Diff for: Lib/_sitebuiltins.py

+5-1
Original file line numberDiff line numberDiff line change
@@ -87,8 +87,12 @@ def __call__(self):
8787

8888
class _Helper(object):
8989
"""Define the builtin 'help'.
90-
This is a wrapper around pydoc.help (with a twist).
9190
91+
This is a wrapper around pydoc.help that provides a helpful message
92+
when 'help' is typed at the Python interactive prompt.
93+
94+
Calling help() at the Python prompt starts an interactive help session.
95+
Calling help(thing) prints help for the python object 'thing'.
9296
"""
9397

9498
def __repr__(self):

Diff for: Lib/pydoc.py

+4-3
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
#!/usr/bin/env python3
22
"""Generate Python documentation in HTML or text for interactive use.
33
4-
In the Python interpreter, do "from pydoc import help" to provide
5-
help. Calling help(thing) on a Python object documents the object.
4+
At the Python interactive prompt, calling help(thing) on a Python object
5+
documents the object, and calling help() starts up an interactive
6+
help session.
67
78
Or, at the shell command line outside of Python:
89
@@ -1865,7 +1866,7 @@ def help(self, request):
18651866

18661867
def intro(self):
18671868
self.output.write('''
1868-
Welcome to Python %s! This is the interactive help utility.
1869+
Welcome to Python %s's help utility!
18691870
18701871
If this is your first time using Python, you should definitely check out
18711872
the tutorial on the Internet at http://docs.python.org/%s/tutorial/.

0 commit comments

Comments
 (0)