正是在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