diff options
author | Guido van Rossum <guido@python.org> | 2001-06-12 16:48:52 (GMT) |
---|---|---|
committer | Guido van Rossum <guido@python.org> | 2001-06-12 16:48:52 (GMT) |
commit | 83213cc0a0e052cb899f83a9848557db02528aa1 (patch) | |
tree | 8010cab3672711f442859c486c670646bdcdf43f /Lib | |
parent | da4dbc36c102d5005737365f65627bbca1d2395b (diff) | |
download | cpython-83213cc0a0e052cb899f83a9848557db02528aa1.zip cpython-83213cc0a0e052cb899f83a9848557db02528aa1.tar.gz cpython-83213cc0a0e052cb899f83a9848557db02528aa1.tar.bz2 |
Add new built-in 'help' which invokes pydoc.help (with a twist).
Diffstat (limited to 'Lib')
-rw-r--r-- | Lib/site.py | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/Lib/site.py b/Lib/site.py index 73b3281..b8174f9 100644 --- a/Lib/site.py +++ b/Lib/site.py @@ -236,6 +236,20 @@ __builtin__.license = _Printer( [os.path.join(here, os.pardir), here, os.curdir]) +# Define new built-in 'help'. +# This is a wrapper around pydoc.help (with a twist). + +class _Helper: + def __repr__(self): + return "Type help() for interactive help, " \ + "or help(object) for help about object." + def __call__(self, *args, **kwds): + import pydoc + return pydoc.help(*args, **kwds) + +__builtin__.help = _Helper() + + # Set the string encoding used by the Unicode implementation. The # default is 'ascii', but if you're willing to experiment, you can # change this. |