diff options
author | Raymond Hettinger <python@rcn.com> | 2002-06-01 14:18:47 (GMT) |
---|---|---|
committer | Raymond Hettinger <python@rcn.com> | 2002-06-01 14:18:47 (GMT) |
commit | 54f0222547b1e92cd018ef132307a6f793dc9505 (patch) | |
tree | 667480d89feb3f9c7ca44e4ffa7bf39e725c120d /Lib/inspect.py | |
parent | 9d5e4aa4149edb92f6d28c9390d776ae4a1d719a (diff) | |
download | cpython-54f0222547b1e92cd018ef132307a6f793dc9505.zip cpython-54f0222547b1e92cd018ef132307a6f793dc9505.tar.gz cpython-54f0222547b1e92cd018ef132307a6f793dc9505.tar.bz2 |
SF 563203. Replaced 'has_key()' with 'in'.
Diffstat (limited to 'Lib/inspect.py')
-rw-r--r-- | Lib/inspect.py | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/Lib/inspect.py b/Lib/inspect.py index ecd3fc9..e40ec8d 100644 --- a/Lib/inspect.py +++ b/Lib/inspect.py @@ -356,12 +356,12 @@ def getmodule(object): file = getabsfile(object) except TypeError: return None - if modulesbyfile.has_key(file): + if file in modulesbyfile: return sys.modules[modulesbyfile[file]] for module in sys.modules.values(): if hasattr(module, '__file__'): modulesbyfile[getabsfile(module)] = module.__name__ - if modulesbyfile.has_key(file): + if file in modulesbyfile: return sys.modules[modulesbyfile[file]] main = sys.modules['__main__'] if hasattr(main, object.__name__): @@ -529,7 +529,7 @@ def walktree(classes, children, parent): classes.sort(lambda a, b: cmp(a.__name__, b.__name__)) for c in classes: results.append((c, c.__bases__)) - if children.has_key(c): + if c in children: results.append(walktree(children[c], children, c)) return results @@ -547,7 +547,7 @@ def getclasstree(classes, unique=0): for c in classes: if c.__bases__: for parent in c.__bases__: - if not children.has_key(parent): + if not parent in children: children[parent] = [] children[parent].append(c) if unique and parent in classes: break |