[Tutor] help() fails

Aurelio Magalhaes Dias amd@atlas.ucpel.tche.br
Fri Mar 28 14:57:03 2003


On Fri, 28 Mar 2003, Jeff Shannon wrote:

> Jens Kubieziel wrote:
>
> >>>>help()
> >>>>
> >>>>
> >Traceback (most recent call last):
> >  File "<stdin>", line 1, in ?
> >  NameError: name 'help' is not defined
> >
> >kubi@QBI050102:~$ python
> >Python 2.1.3 (#1, Jul 29 2002, 22:34:51)
> >[GCC 2.95.4 20011002 (Debian prerelease)] on linux2
> >Type "copyright", "credits" or "license" for more information.'
> >
>
> I believe that the help() builtin was added in Python 2.2.  While it's
> not nearly as convenient, you can often acheive much the same effect by
> using 'print somemodule.__doc__' or 'print function.__doc__' -- the
> help() facility just shows docstrings for the module and any classes and
> functions within it.
>
> Jeff Shannon
> Technician/Programmer
> Credit International
>

That's right, it was added in Python 2.2.

Aur=E9lio.

-----------------------------------------
        Aur=E9lio Magalh=E3es Dias
        Ci=EAncia da Computa=E7=E3o
        UCPel - RS - Brasil
-----------------------------------------