]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Also remember the module a class is defined in.
authorSjoerd Mullender <sjoerd@acm.org>
Thu, 2 Nov 1995 17:21:33 +0000 (17:21 +0000)
committerSjoerd Mullender <sjoerd@acm.org>
Thu, 2 Nov 1995 17:21:33 +0000 (17:21 +0000)
Lib/pyclbr.py

index c19c7a577e844273174c7e3e472204338e69e355..f6f5bb932e9b3939d65d447abca0d4f958fcfa4c 100644 (file)
@@ -52,7 +52,8 @@ _modules = {}                         # cache of modules we've seen
 # each Python class is represented by an instance of this class
 class Class:
        '''Class to represent a Python class.'''
-       def __init__(self, name, super, file, lineno):
+       def __init__(self, module, name, super, file, lineno):
+               self.module = module
                self.name = name
                if super is None:
                        super = []
@@ -187,7 +188,7 @@ def readmodule(module, path = []):
                                        names.append(n)
                                inherit = names
                        # remember this class
-                       cur_class = Class(class_name, inherit, file, lineno)
+                       cur_class = Class(module, class_name, inherit, file, lineno)
                        dict[class_name] = cur_class
                        continue
                if is_method.match(line) >= 0: