javadoc equivalent for python?

Andrew Dalke dalke at acm.org
Sat Jul 29 01:49:00 EDT 2000


Some commentary, since I've been looking into this question
recently.

richard_chamberlain wrote:
>There is PythonDoc - which I've not used but you can get it at:
>http://starship.python.net/crew/danilo/pythondoc/

As a caution, I've found it hard to understand what the code is
doing.  There seems to be too much code for what it does.  For
example, it's several times larger than Ka-Ping's htmldoc.
There are inconsistancies in several places, like sorting (in
some places, name are sorted case-insensitive and others
case-sensitive.)  There even appear to be a few bugs, like in
the indicies.html where if you have more than 3 levels in your
hierarchy, it uses the CSS class "indent4" but pythondoc.css
doesn't define that class.

>Also Ka-Ping Yee's inspect.py and htmldoc are very good:
>http://www.lfw.org/python/

I like the code better.  It's easier to understand and the output
looks prettier.  Its biggest failing is that it doesn't understand
packages, so submodules are not documented.  It also doesn't
distinguish between what I call a name and an alias

def f():
    pass
g=f

It uses

def document_function(object, ...):
  ...
  anchor = clname + "-" + object.__name__

But the __name__ of g is "f", so the generated output is wrong.

I ended up writing a new system for my client to do what they needed,
because neither of these two were good enough.  Not sure if they'll
release the final code, though :(

                    Andrew
                    dalke at acm.org






More information about the Python-list mailing list