summaryrefslogtreecommitdiffstats
path: root/Lib/inspect.py
diff options
context:
space:
mode:
authorRaymond Hettinger <python@rcn.com>2003-12-01 20:12:15 (GMT)
committerRaymond Hettinger <python@rcn.com>2003-12-01 20:12:15 (GMT)
commit3375fc5a3b3a6f53fff446bfb28147fba4cc2e3a (patch)
treed4d51d097b6b4dd848ed0732f1519cc7e655a65e /Lib/inspect.py
parent0ad142aba05d0ecbbc42117e43cf98201b2cabc9 (diff)
downloadcpython-3375fc5a3b3a6f53fff446bfb28147fba4cc2e3a.zip
cpython-3375fc5a3b3a6f53fff446bfb28147fba4cc2e3a.tar.gz
cpython-3375fc5a3b3a6f53fff446bfb28147fba4cc2e3a.tar.bz2
Apply extract functions instead of lambda.
Diffstat (limited to 'Lib/inspect.py')
-rw-r--r--Lib/inspect.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/Lib/inspect.py b/Lib/inspect.py
index 4874904..0e0e9e5 100644
--- a/Lib/inspect.py
+++ b/Lib/inspect.py
@@ -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: