What tools are used to write and generate PythonLibrarydocumentation.

Fredrik Lundh fredrik at pythonware.com
Tue Sep 27 23:39:36 CEST 2005


Robert Kern wrote:

> The one thing I dislike about PythonDoc is that it puts everything into
> comments and thus docstrings are usually neglected.

teaser:

>>> from elementtree import ElementTree
>>> help(ElementTree)
Help on module ElementTree:

NAME
    ElementTree

DESCRIPTION
    # ElementTree
    # $Id: ElementTree.py 2324 2005-03-16 15:49:27Z fredrik $
    #
    # light-weight XML support for Python 1.5.2 and later.
    ...

CLASSES
    Element
    ElementTree
    QName
    TreeBuilder
    XMLParser
    iterparse

    class Element
     |  Methods defined here:
     |
     |  __delitem__(self, index)
     |
     |  __delslice__(self, start, stop)
     |
     |  __getitem__(self, index)
     |
     |  __getslice__(self, start, stop)
     ...

>>> import pythondoc
>>> help(ElementTree)
Help on module ElementTree:

NAME
    ElementTree

DESCRIPTION
    The Element type is a flexible container object, designed to
    store hierarchical data structures in memory.

CLASSES
    Element
    ElementTree
    QName
    TreeBuilder
    XMLParser
    iterparse

    class Element
     |  Element class.
     |
     |  Methods defined here:
     |
     |  __delitem__(self, index)
     |      Deletes the given subelement.
     |
     |  __delslice__(self, start, stop)
     |      Deletes a number of subelements.
     |
     |  __getitem__(self, index)
     |      Returns the given subelement.
     |
     |  __getslice__(self, start, stop)
     |      Returns a list containing subelements in the given range.
     ...

now, if I could only motivate myself to write a PEP on adding a __help__
hook to pydoc, so that the "help" command can be taught to do this all by
itself...

</F> 






More information about the Python-list mailing list