Home | History | Annotate | Download | only in python2.7

Lines Matching defs:Class

3 Parse enough of a Python file to recognize imports and class and
4 method definitions, and to find out the superclasses of a class.
13 via the from XXX import YYY construct). The values are class
14 instances of the class Class defined here. One special key/value pair
18 A class is described by the class Class in this module. Instances
19 of this class have the following instance variables:
21 name -- the name of the class
22 super -- a list of super classes (Class instances)
24 file -- the file in which the class was defined
25 lineno -- the line in the file on which the class statement occurred
28 If the name of a super class is not recognized, the corresponding
29 entry in the list of super classes is not a class instance but a
30 string giving the name of the super class. Since import statements
34 A function is described by the class Function in this module.
35 Instances of this class have the following instance variables:
37 name -- the name of the class
38 file -- the file in which the class was defined
39 lineno -- the line in the file on which the class statement occurred
48 __all__ = ["readmodule", "readmodule_ex", "Class", "Function"]
52 # each Python class is represented by an instance of this class
53 class Class:
54 '''Class to represent a Python class.'''
68 class Function:
69 '''Class to represent a top-level Python function'''
79 Call readmodule_ex() and then only keep Class objects from the
84 if isinstance(value, Class):
92 module and return a dictionary with one entry for each class
151 stack = [] # stack of (class, indent) pairs
171 if isinstance(cur_class, Class):
180 elif token == 'class':
188 # parse what follows the class name
201 # we know this super class
206 # super class is of the form
207 # module.class: look in module for
208 # class
230 cur_class = Class(fullmodule, class_name, inherit,
334 if isinstance(obj, Class):
335 print "class", obj.name, obj.super, obj.lineno