Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
e058b5e9
Commit
e058b5e9
authored
Mar 11, 2005
by
Raymond Hettinger
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Apply itemgetter() instead of lambda.
parent
16d433d8
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
1 deletion
+2
-1
Lib/inspect.py
Lib/inspect.py
+2
-1
No files found.
Lib/inspect.py
View file @
e058b5e9
...
@@ -29,6 +29,7 @@ __author__ = 'Ka-Ping Yee <ping@lfw.org>'
...
@@ -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):
...
@@ -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:
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment