From: Sjoerd Mullender Date: Thu, 2 Nov 1995 17:21:33 +0000 (+0000) Subject: Also remember the module a class is defined in. X-Git-Tag: v1.4b1~500 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=825bae7c35b259551a660ac21c783f2937167bec;p=thirdparty%2FPython%2Fcpython.git Also remember the module a class is defined in. --- diff --git a/Lib/pyclbr.py b/Lib/pyclbr.py index c19c7a577e84..f6f5bb932e9b 100644 --- a/Lib/pyclbr.py +++ b/Lib/pyclbr.py @@ -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: