summaryrefslogtreecommitdiffstats
path: root/Lib/pyclbr.py
diff options
context:
space:
mode:
authorRaymond Hettinger <python@rcn.com>2008-01-30 02:55:10 (GMT)
committerRaymond Hettinger <python@rcn.com>2008-01-30 02:55:10 (GMT)
commitd4cb56d4e88c7e001bbaba2c80953db47632f199 (patch)
tree73c95e0223ed8a98fac797fc99ab1bffae9c5457 /Lib/pyclbr.py
parentfd66e51c4c1ff9293b0f332d6ebc8093b2ef12bb (diff)
downloadcpython-d4cb56d4e88c7e001bbaba2c80953db47632f199.zip
cpython-d4cb56d4e88c7e001bbaba2c80953db47632f199.tar.gz
cpython-d4cb56d4e88c7e001bbaba2c80953db47632f199.tar.bz2
Convert some custom sort comparison functions to equivalent key functions.
Diffstat (limited to 'Lib/pyclbr.py')
-rw-r--r--Lib/pyclbr.py3
1 files changed, 1 insertions, 2 deletions
diff --git a/Lib/pyclbr.py b/Lib/pyclbr.py
index c402a09..cf4951c 100644
--- a/Lib/pyclbr.py
+++ b/Lib/pyclbr.py
@@ -324,8 +324,7 @@ def _main():
path = []
dict = readmodule_ex(mod, path)
objs = dict.values()
- objs.sort(lambda a, b: cmp(getattr(a, 'lineno', 0),
- getattr(b, 'lineno', 0)))
+ objs.sort(key=lambda a: getattr(a, 'lineno', 0))
for obj in objs:
if isinstance(obj, Class):
print("class", obj.name, obj.super, obj.lineno)