Apply extract functions instead of lambda.

This commit is contained in:
Raymond Hettinger 2003-12-01 20:12:15 +00:00
parent 0ad142aba0
commit 3375fc5a3b
2 changed files with 4 additions and 3 deletions

View file

@ -29,6 +29,7 @@ __author__ = 'Ka-Ping Yee <ping@lfw.org>'
__date__ = '1 Jan 2001'
import sys, os, types, string, re, dis, imp, tokenize, linecache
from operator import attrgetter
# ----------------------------------------------------------- type-checking
def ismodule(object):
@ -553,7 +554,7 @@ def getsource(object):
def walktree(classes, children, parent):
"""Recursive helper function for getclasstree()."""
results = []
classes.sort(key=lambda c: c.__name__)
classes.sort(key=attrgetter('__name__'))
for c in classes:
results.append((c, c.__bases__))
if c in children: