[Python-checkins] cpython (merge 3.4 -> default): Merge: #9364: Improve the text printed by help(pydoc) and help(help).
r.david.murray
python-checkins at python.org
Sat Apr 19 19:06:49 CEST 2014
http://hg.python.org/cpython/rev/256c782ab078
changeset: 90412:256c782ab078
parent: 90410:ffb1845e96e6
parent: 90411:16207b8495bf
user: R David Murray <rdmurray at bitdance.com>
date: Sat Apr 19 13:01:21 2014 -0400
summary:
Merge: #9364: Improve the text printed by help(pydoc) and help(help).
files:
Lib/_sitebuiltins.py | 6 +++++-
Lib/pydoc.py | 7 ++++---
2 files changed, 9 insertions(+), 4 deletions(-)
diff --git a/Lib/_sitebuiltins.py b/Lib/_sitebuiltins.py
--- a/Lib/_sitebuiltins.py
+++ b/Lib/_sitebuiltins.py
@@ -87,8 +87,12 @@
class _Helper(object):
"""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):
diff --git a/Lib/pydoc.py b/Lib/pydoc.py
--- a/Lib/pydoc.py
+++ b/Lib/pydoc.py
@@ -1,8 +1,9 @@
#!/usr/bin/env python3
"""Generate Python documentation in HTML or text for interactive use.
-In the Python interpreter, do "from pydoc import help" to provide
-help. Calling help(thing) on a Python object documents the object.
+At the Python interactive prompt, calling help(thing) on a Python object
+documents the object, and calling help() starts up an interactive
+help session.
Or, at the shell command line outside of Python:
@@ -1865,7 +1866,7 @@
def intro(self):
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
the tutorial on the Internet at http://docs.python.org/%s/tutorial/.
--
Repository URL: http://hg.python.org/cpython
More information about the Python-checkins
mailing list