Skip to content

Commit 1d822ca

Browse files
committed
more accurate help(help) output
1 parent c6912de commit 1d822ca

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

Lib/pydoc.py

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2117,21 +2117,25 @@ def helphelp(self, is_interactive=False):
21172117
pager(textwrap.dedent("""\
21182118
help - Interactive Help
21192119
=======================
2120+
21202121
The built-in help function implements an interactive help utility. You
21212122
can make use of it in a few different ways:
21222123
21232124
* Calling help() with no arguments starts an interactive help session.
21242125
2125-
* Calling help(x) will have one of two behaviors depending on the type
2126-
of the argument:
2126+
* The behavior of help(x) depends on the type of the argument:
21272127
21282128
* If x is a string, help(x) provides information about the given
21292129
topic. For example, help("class") will provide information about
21302130
the "class" keyword, and help("math.sqrt") will provide
21312131
information about the "math.sqrt" function.
21322132
2133-
* If x is not a string, help(x) prints information about x's type.
2134-
For example, help(42) will provide information about the int type.
2133+
* If x is a class or a built-in type, help(x) provides information
2134+
about that type. For example, help(str) will provide information
2135+
about the str type.
2136+
2137+
* Otherwise, help(x) provides information about x's type. For
2138+
example, help(42) will provide information about the int type.
21352139
"""))
21362140

21372141
def intro(self):

0 commit comments

Comments
 (0)