mirror of
https://github.com/python/cpython.git
synced 2025-11-03 19:34:08 +00:00
Merge: #9364: Improve the text printed by help(pydoc) and help(help).
This commit is contained in:
commit
0fbd76b023
2 changed files with 9 additions and 4 deletions
|
|
@ -87,8 +87,12 @@ class _Printer(object):
|
||||||
|
|
||||||
class _Helper(object):
|
class _Helper(object):
|
||||||
"""Define the builtin 'help'.
|
"""Define the builtin 'help'.
|
||||||
This is a wrapper around pydoc.help (with a twist).
|
|
||||||
|
|
||||||
|
This is a wrapper around pydoc.help that provides a helpful message
|
||||||
|
when 'help' is typed at the Python interactive prompt.
|
||||||
|
|
||||||
|
Calling help() at the Python prompt starts an interactive help session.
|
||||||
|
Calling help(thing) prints help for the python object 'thing'.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
def __repr__(self):
|
def __repr__(self):
|
||||||
|
|
|
||||||
|
|
@ -1,8 +1,9 @@
|
||||||
#!/usr/bin/env python3
|
#!/usr/bin/env python3
|
||||||
"""Generate Python documentation in HTML or text for interactive use.
|
"""Generate Python documentation in HTML or text for interactive use.
|
||||||
|
|
||||||
In the Python interpreter, do "from pydoc import help" to provide
|
At the Python interactive prompt, calling help(thing) on a Python object
|
||||||
help. Calling help(thing) on a Python object documents the object.
|
documents the object, and calling help() starts up an interactive
|
||||||
|
help session.
|
||||||
|
|
||||||
Or, at the shell command line outside of Python:
|
Or, at the shell command line outside of Python:
|
||||||
|
|
||||||
|
|
@ -1865,7 +1866,7 @@ has the same effect as typing a particular string at the help> prompt.
|
||||||
|
|
||||||
def intro(self):
|
def intro(self):
|
||||||
self.output.write('''
|
self.output.write('''
|
||||||
Welcome to Python %s! This is the interactive help utility.
|
Welcome to Python %s's help utility!
|
||||||
|
|
||||||
If this is your first time using Python, you should definitely check out
|
If this is your first time using Python, you should definitely check out
|
||||||
the tutorial on the Internet at http://docs.python.org/%s/tutorial/.
|
the tutorial on the Internet at http://docs.python.org/%s/tutorial/.
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue