Bump version to 0.9.1.
[python/dscho.git] / Doc / lib / libpyclbr.tex
blob8e89fcfbf9ab373147b47cca50e7d6be50d90d7e
1 \section{\module{pyclbr} ---
2 Python class browser support}
4 \declaremodule{standard}{pyclbr}
5 \modulesynopsis{Supports information extraction for a Python class
6 browser.}
7 \sectionauthor{Fred L. Drake, Jr.}{fdrake@acm.org}
10 The \module{pyclbr} can be used to determine some limited information
11 about the classes and methods defined in a module. The information
12 provided is sufficient to implement a traditional three-pane class
13 browser. The information is extracted from the source code rather
14 than from an imported module, so this module is safe to use with
15 untrusted source code. This restriction makes it impossible to use
16 this module with modules not implemented in Python, including many
17 standard and optional extension modules.
20 \begin{funcdesc}{readmodule}{module\optional{, path}}
21 % The 'inpackage' parameter appears to be for internal use only....
22 Read a module and return a dictionary mapping class names to class
23 descriptor objects. The parameter \var{module} should be the name
24 of a module as a string; it may be the name of a module within a
25 package. The \var{path} parameter should be a sequence, and is used
26 to augment the value of \code{sys.path}, which is used to locate
27 module source code.
28 \end{funcdesc}
31 \subsection{Class Descriptor Objects \label{pyclbr-class-objects}}
33 The class descriptor objects used as values in the dictionary returned
34 by \function{readmodule()} provide the following data members:
37 \begin{memberdesc}[class descriptor]{module}
38 The name of the module defining the class described by the class
39 descriptor.
40 \end{memberdesc}
42 \begin{memberdesc}[class descriptor]{name}
43 The name of the class.
44 \end{memberdesc}
46 \begin{memberdesc}[class descriptor]{super}
47 A list of class descriptors which describe the immediate base
48 classes of the class being described. Classes which are named as
49 superclasses but which are not discoverable by
50 \function{readmodule()} are listed as a string with the class name
51 instead of class descriptors.
52 \end{memberdesc}
54 \begin{memberdesc}[class descriptor]{methods}
55 A dictionary mapping method names to line numbers.
56 \end{memberdesc}
58 \begin{memberdesc}[class descriptor]{file}
59 Name of the file containing the class statement defining the class.
60 \end{memberdesc}
62 \begin{memberdesc}[class descriptor]{lineno}
63 The line number of the class statement within the file named by
64 \member{file}.
65 \end{memberdesc}