mirror of
https://github.com/python/cpython.git
synced 2025-08-03 16:39:00 +00:00
Convert some custom sort comparison functions to equivalent key functions.
This commit is contained in:
parent
fd66e51c4c
commit
d4cb56d4e8
12 changed files with 50 additions and 20 deletions
|
@ -797,10 +797,7 @@ class HTMLDoc(Doc):
|
|||
tag += ':<br>\n'
|
||||
|
||||
# Sort attrs by name.
|
||||
try:
|
||||
attrs.sort(key=lambda t: t[0])
|
||||
except TypeError:
|
||||
attrs.sort(lambda t1, t2: cmp(t1[0], t2[0])) # 2.3 compat
|
||||
attrs.sort(key=lambda t: t[0])
|
||||
|
||||
# Pump out the attrs, segregated by kind.
|
||||
attrs = spill('Methods %s' % tag, attrs,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue