rest25/library/pyclbr.rst => rest262/library/pyclbr.rst
2:mod:`pyclbr` --- Python class browser support
3==============================================
4
5.. module:: pyclbr
6   :synopsis: Supports information extraction for a Python class browser.
7.. sectionauthor:: Fred L. Drake, Jr. <fdrake@acm.org>
8
9
n10-The :mod:`pyclbr` can be used to determine some limited information about the
n10+The :mod:`pyclbr` module can be used to determine some limited information
11-classes, methods and top-level functions defined in a module.  The information
11+about the classes, methods and top-level functions defined in a module.  The
12-provided is sufficient to implement a traditional three-pane class browser.  The
12+information provided is sufficient to implement a traditional three-pane
13-information is extracted from the source code rather than by importing the
13+class browser.  The information is extracted from the source code rather
14-module, so this module is safe to use with untrusted source code.  This
14+than by importing the module, so this module is safe to use with untrusted
15-restriction makes it impossible to use this module with modules not implemented
15+code.  This restriction makes it impossible to use this module with modules
16-in Python, including many standard and optional extension modules.
16+not implemented in Python, including all standard and optional extension
17+modules.
17
18
n19-.. function:: readmodule(module[, path])
n20+.. function:: readmodule(module[, path=None])
20
n21-   Read a module and return a dictionary mapping class names to class descriptor
n22+   Read a module and return a dictionary mapping class names to class
22-   objects.  The parameter *module* should be the name of a module as a string; it
23+   descriptor objects.  The parameter *module* should be the name of a
23-   may be the name of a module within a package.  The *path* parameter should be a
24+   module as a string; it may be the name of a module within a package.  The
24-   sequence, and is used to augment the value of ``sys.path``, which is used to
25+   *path* parameter should be a sequence, and is used to augment the value
25-   locate module source code.
26+   of ``sys.path``, which is used to locate module source code.
26- 
27-   .. % The 'inpackage' parameter appears to be for internal use only....
28
29
n30-.. function:: readmodule_ex(module[, path])
n29+.. function:: readmodule_ex(module[, path=None])
31
n32-   Like :func:`readmodule`, but the returned dictionary, in addition to mapping
n31+   Like :func:`readmodule`, but the returned dictionary, in addition to
33-   class names to class descriptor objects, also maps top-level function names to
32+   mapping class names to class descriptor objects, also maps top-level
34-   function descriptor objects.  Moreover, if the module being read is a package,
33+   function names to function descriptor objects.  Moreover, if the module
35-   the key ``'__path__'`` in the returned dictionary has as its value a list which
34+   being read is a package, the key ``'__path__'`` in the returned
36-   contains the package search path.
35+   dictionary has as its value a list which contains the package search
37- 
36+   path.
38-   .. % The 'inpackage' parameter appears to be for internal use only....
39
40
41.. _pyclbr-class-objects:
42
n43-Class Descriptor Objects
n41+Class Objects
44-------------------------
42+-------------
45
n46-The class descriptor objects used as values in the dictionary returned by
n44+The :class:`Class` objects used as values in the dictionary returned by
47-:func:`readmodule` and :func:`readmodule_ex` provide the following data members:
45+:func:`readmodule` and :func:`readmodule_ex` provide the following data
46+members:
48
49
n50-.. attribute:: class descriptor.module
n49+.. attribute:: Class.module
51
52   The name of the module defining the class described by the class descriptor.
53
54
n55-.. attribute:: class descriptor.name
n54+.. attribute:: Class.name
56
57   The name of the class.
58
59
n60-.. attribute:: class descriptor.super
n59+.. attribute:: Class.super
61
n62-   A list of class descriptors which describe the immediate base classes of the
n61+   A list of :class:`Class` objects which describe the immediate base
63-   class being described.  Classes which are named as superclasses but which are
62+   classes of the class being described.  Classes which are named as
64-   not discoverable by :func:`readmodule` are listed as a string with the class
63+   superclasses but which are not discoverable by :func:`readmodule` are
65-   name instead of class descriptors.
64+   listed as a string with the class name instead of as :class:`Class`
65+   objects.
66
67
n68-.. attribute:: class descriptor.methods
n68+.. attribute:: Class.methods
69
70   A dictionary mapping method names to line numbers.
71
72
n73-.. attribute:: class descriptor.file
n73+.. attribute:: Class.file
74
75   Name of the file containing the ``class`` statement defining the class.
76
77
n78-.. attribute:: class descriptor.lineno
n78+.. attribute:: Class.lineno
79
80   The line number of the ``class`` statement within the file named by
81   :attr:`file`.
82
83
84.. _pyclbr-function-objects:
85
n86-Function Descriptor Objects
n86+Function Objects
87----------------------------
87+----------------
88
n89-The function descriptor objects used as values in the dictionary returned by
n89+The :class:`Function` objects used as values in the dictionary returned by
90:func:`readmodule_ex` provide the following data members:
91
92
n93-.. attribute:: function descriptor.module
n93+.. attribute:: Function.module
94
95   The name of the module defining the function described by the function
96   descriptor.
97
98
n99-.. attribute:: function descriptor.name
n99+.. attribute:: Function.name
100
101   The name of the function.
102
103
n104-.. attribute:: function descriptor.file
n104+.. attribute:: Function.file
105
106   Name of the file containing the ``def`` statement defining the function.
107
108
n109-.. attribute:: function descriptor.lineno
n109+.. attribute:: Function.lineno
110
t111-   The line number of the ``def`` statement within the file named by :attr:`file`.
t111+   The line number of the ``def`` statement within the file named by
112+   :attr:`file`.
112
Legends
Colors
 Added 
Changed
Deleted
Links
(f)irst change
(n)ext change
(t)op