[Edu-sig] Re: [Idle-dev] Weird error when pydoc.help is added to builtin from site.py

Patrick K. O'Brien pobrien@orbtech.com
Tue, 12 Jun 2001 10:46:34 -0500


Import pydoc; pydoc.help definitely works. In fact, adding help to the
builtins works from my PYTHONSTARTUP file or interactively, but not from
site.py. That's what made it so weird, at least to me. But getting it loaded
as part of site was our goal. I'll step through the code when I get a spare
hour (or two or three <g>).

>>> import __builtin__
>>> from pydoc import help
>>> __builtin__.help = help
>>> del help
>>> del __builtin__
>>> help

Welcome to Python 2.1!  This is the online help utility.

If this is your first time using Python, you should definitely check out
the tutorial on the Internet at http://www.python.org/doc/tut/.

Enter the name of any module, keyword, or topic to get help on writing
Python programs and using Python modules.  To quit this help utility and
return to the interpreter, just type "quit".

To get a list of available modules, keywords, or topics, type "modules",
"keywords", or "topics".  Each module also comes with a one-line summary
of what it does; to list the modules whose summaries contain a given word
such as "spam", type "modules spam".

help>

---
Patrick K. O'Brien
Orbtech
"I am, therefore I think."

-----Original Message-----
From: guido@odiug.digicool.com [mailto:guido@odiug.digicool.com]On Behalf Of
Guido van Rossum
Sent: Tuesday, June 12, 2001 10:20 AM
To: pobrien@orbtech.com
Cc: Guido van Rossum; IDLE Developers List; ping@lfw.org; Python Edu SIG
Subject: Re: [Edu-sig] Re: [Idle-dev] Weird error when pydoc.help is added
to builtin from site.py

<snip>
See if this also breaks when you do this in IDLE:

  >>> import pydoc
  >>> pydoc.help()

That eliminates the manipulation with __builtin__ as the cause of the
problem.  Then you'll have to step through the code or use pdb.pm() to
find out what was wrong...

--Guido van Rossum (home page: http://www.python.org/~guido/)