Convert some custom sort comparison functions to equivalent key functions.

This commit is contained in:
Raymond Hettinger 2008-01-30 02:55:10 +00:00
parent fd66e51c4c
commit d4cb56d4e8
12 changed files with 50 additions and 20 deletions

View file

@ -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,