Best way to document Python code...

Neil Cerutti horpner at yahoo.com
Tue Jan 23 17:28:48 CET 2007


On 2007-01-22, bearophileHUGS at lycos.com <bearophileHUGS at lycos.com> wrote:
> Boris Ozegovic:
>> Does Python has API just like in Java, for example
>> http://java.sun.com/j2se/1.5.0/docs/api/allclasses-noframe.html ctrl-f and
>> than click on class you are searching for, and finally you get clean list
>> of all fields and methods.  Where can I find similar in Python, for
>> example, if I would like to see which methods list/dictionary has.
>
> You can do that from the shell, with help(name) or dir(name),
> where name can be a class, object, most things.

It is OK for a lark, but sadly dir is not suitable enough. You do
need to refer to the documentation off-line or you'll miss vital
entries. It won't hurt to read effbot.org, either, as I keep
finding out.

Also check out the interactive help system. If you've got the
html versions of the docs installed, it functions somewhat like
perldoc. Type help() at the interactive prompt to get started.

-- 
Neil Cerutti
Will the last person to leave please see that the perpetual light is
extinguished --sign at New England church

-- 
Posted via a free Usenet account from http://www.teranews.com




More information about the Python-list mailing list