From: Skip Montanaro Date: Mon, 20 Sep 2004 16:43:30 +0000 (+0000) Subject: Raymond reminded me to use DSU key X-Git-Tag: v2.4b1~230 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=13dea5a42bfd65a817c884a97f06c2c2b612490e;p=python Raymond reminded me to use DSU key --- diff --git a/Lib/inspect.py b/Lib/inspect.py index 101c7ec08b..b359dcd01a 100644 --- a/Lib/inspect.py +++ b/Lib/inspect.py @@ -557,8 +557,7 @@ def getsource(object): def walktree(classes, children, parent): """Recursive helper function for getclasstree().""" results = [] - classes.sort(lambda a, b: cmp("%s.%s" % (a.__module__, a.__name__), - "%s.%s" % (b.__module__, b.__name__))) + classes.sort(key=lambda c: (c.__module__, c.__name__)) for c in classes: results.append((c, c.__bases__)) if c in children: