[Python-checkins] python/dist/src/Lib inspect.py,1.60,1.61
rhettinger at users.sourceforge.net
rhettinger at users.sourceforge.net
Fri Mar 11 07:46:50 CET 2005
Update of /cvsroot/python/python/dist/src/Lib
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv16083
Modified Files:
inspect.py
Log Message:
Apply itemgetter() instead of lambda.
Index: inspect.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/inspect.py,v
retrieving revision 1.60
retrieving revision 1.61
diff -u -d -r1.60 -r1.61
--- inspect.py 6 Feb 2005 06:57:07 -0000 1.60
+++ inspect.py 11 Mar 2005 06:46:45 -0000 1.61
@@ -29,6 +29,7 @@
__date__ = '1 Jan 2001'
import sys, os, types, string, re, dis, imp, tokenize, linecache
+from operator import attrgetter
# ----------------------------------------------------------- type-checking
def ismodule(object):
@@ -567,7 +568,7 @@
def walktree(classes, children, parent):
"""Recursive helper function for getclasstree()."""
results = []
- classes.sort(key=lambda c: (c.__module__, c.__name__))
+ classes.sort(key=attrgetter('__module__', '__name__'))
for c in classes:
results.append((c, c.__bases__))
if c in children:
More information about the Python-checkins
mailing list