On 06/21/2010 07:17 PM, Peng Yu wrote:
> help(help) gives me the following explanation.
> 
> [snip]
> 
> I then looked at pydoc site. But I don't see an entry on help(). How
> to figure out where help() (or a function in general) is defined?

>>> type(dir)
<class 'builtin_function_or_method'>
>>> type(help)
<class 'site._Helper'>
>>>


help is not a function, it's an instance of site._Helper. It just
"feels" like a function by being callable.
You could create your own "help" callable simply by using the _Helper
contructor:

>>> import site
>>> help2 = site._Helper()
>>>


-- Thomas
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to