[Python-checkins] CVS: python/dist/src/Lib site.py,1.26,1.27
Guido van Rossum
gvanrossum@users.sourceforge.net
Tue, 12 Jun 2001 09:48:54 -0700
Update of /cvsroot/python/python/dist/src/Lib
In directory usw-pr-cvs1:/tmp/cvs-serv12111/Lib
Modified Files:
site.py
Log Message:
Add new built-in 'help' which invokes pydoc.help (with a twist).
Index: site.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/site.py,v
retrieving revision 1.26
retrieving revision 1.27
diff -C2 -r1.26 -r1.27
*** site.py 2001/03/23 17:53:49 1.26
--- site.py 2001/06/12 16:48:52 1.27
***************
*** 237,240 ****
--- 237,254 ----
+ # 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