正是在site.py
,如果使用help.__class__
你会看到它是site._Helper
这仅仅是一个围绕pydoc.help
包装:
class _Helper(object):
"""Define the builtin 'help'.
This is a wrapper around pydoc.help (with a twist).
"""
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)
def sethelper():
__builtin__.help = _Helper()
help(object)
是:从site.py
In [1]: help.__class__
Out[1]: site._Helper
_Helper
类相当于__builtin__.help(object)
,它将对象传递给pydoc.help
。
HTTP的帮助://计算器。com/questions/5430020/python-how-to-get-information-about-a-function http://stackoverflow.com/questions/139180/listing-all-functions-in-a-python-module – 2015-02-24 14:41:58