[Python-Dev] Python 2.1 PEPs

Paul Prescod paulp@ActiveState.com
Tue, 17 Apr 2001 10:28:15 -0700


Guido van Rossum wrote:
> 
>...
> 
> Actually, "from pydoc import help" already works; after that you can
> type "help" or "help(module)" etc.  Or is "online help" more than
> that?

No, that looks like it is basically what you want. I didn't envision
help as a totally separate "mode" but I'm not picky.

> Ping pointed out (in private email) that adding pydoc.help to
> __builtin__ in site.py is the wrong thing to do because pydoc is large
> and it would slow down startup too much.  He recommended to add a
> small bootstrap function instead that imports and invokes pydoc.help
> instead.

Right, but the bootstrap was always part of the proposal! Now that
you've pointed out the impressive online help facility in pydoc it seems
that the only thing we need to make it exactly what I envisioned is a
few lines of code. I'm sorry I didn't figure that out last week!

All it would take now is

class help:
   def __repr__(self):
      import pydoc
      __builtins__.help = pydoc.help
      repr(__builtins__.help)

But hindsight is 20/20.

-- 
Take a recipe. Leave a recipe.  
Python Cookbook!  http://www.ActiveState.com/pythoncookbook