diff options
author | Sjoerd Mullender <sjoerd@acm.org> | 1995-11-02 17:21:33 +0000 |
---|---|---|
committer | Sjoerd Mullender <sjoerd@acm.org> | 1995-11-02 17:21:33 +0000 |
commit | 521ea6eaebe13bd81bae93b9965c80d8ca46d621 (patch) | |
tree | ef340dc48d699061a3f349d92bd85f3571a11d32 /Lib/pyclbr.py | |
parent | 7ba9a4c76e9c2867bfa847adf58fbaae34e392e5 (diff) | |
download | cpython-521ea6eaebe13bd81bae93b9965c80d8ca46d621.tar.gz |
Also remember the module a class is defined in.
Diffstat (limited to 'Lib/pyclbr.py')
-rw-r--r-- | Lib/pyclbr.py | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/Lib/pyclbr.py b/Lib/pyclbr.py index c19c7a577e..f6f5bb932e 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: |