mirror of
https://github.com/python/cpython.git
synced 2025-09-26 18:29:57 +00:00
Apply itemgetter() instead of lambda.
This commit is contained in:
parent
01668a1ab9
commit
a1a992c0a0
1 changed files with 2 additions and 1 deletions
|
@ -29,6 +29,7 @@ __author__ = 'Ka-Ping Yee <ping@lfw.org>'
|
||||||
__date__ = '1 Jan 2001'
|
__date__ = '1 Jan 2001'
|
||||||
|
|
||||||
import sys, os, types, string, re, dis, imp, tokenize, linecache
|
import sys, os, types, string, re, dis, imp, tokenize, linecache
|
||||||
|
from operator import attrgetter
|
||||||
|
|
||||||
# ----------------------------------------------------------- type-checking
|
# ----------------------------------------------------------- type-checking
|
||||||
def ismodule(object):
|
def ismodule(object):
|
||||||
|
@ -567,7 +568,7 @@ def getsource(object):
|
||||||
def walktree(classes, children, parent):
|
def walktree(classes, children, parent):
|
||||||
"""Recursive helper function for getclasstree()."""
|
"""Recursive helper function for getclasstree()."""
|
||||||
results = []
|
results = []
|
||||||
classes.sort(key=lambda c: (c.__module__, c.__name__))
|
classes.sort(key=attrgetter('__module__', '__name__'))
|
||||||
for c in classes:
|
for c in classes:
|
||||||
results.append((c, c.__bases__))
|
results.append((c, c.__bases__))
|
||||||
if c in children:
|
if c in children:
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue