diff options
author | Raymond Hettinger <python@rcn.com> | 2003-12-01 20:12:15 (GMT) |
---|---|---|
committer | Raymond Hettinger <python@rcn.com> | 2003-12-01 20:12:15 (GMT) |
commit | 3375fc5a3b3a6f53fff446bfb28147fba4cc2e3a (patch) | |
tree | d4d51d097b6b4dd848ed0732f1519cc7e655a65e /Lib/pyclbr.py | |
parent | 0ad142aba05d0ecbbc42117e43cf98201b2cabc9 (diff) | |
download | cpython-3375fc5a3b3a6f53fff446bfb28147fba4cc2e3a.zip cpython-3375fc5a3b3a6f53fff446bfb28147fba4cc2e3a.tar.gz cpython-3375fc5a3b3a6f53fff446bfb28147fba4cc2e3a.tar.bz2 |
Apply extract functions instead of lambda.
Diffstat (limited to 'Lib/pyclbr.py')
-rw-r--r-- | Lib/pyclbr.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/Lib/pyclbr.py b/Lib/pyclbr.py index 26cc0ce..6674b71 100644 --- a/Lib/pyclbr.py +++ b/Lib/pyclbr.py @@ -43,6 +43,7 @@ import sys import imp import tokenize # Python tokenizer from token import NAME, DEDENT, NEWLINE +from operator import itemgetter __all__ = ["readmodule", "readmodule_ex", "Class", "Function"] @@ -326,8 +327,7 @@ def _main(): for obj in objs: if isinstance(obj, Class): print "class", obj.name, obj.super, obj.lineno - methods = obj.methods.items() - methods.sort(lambda a, b: cmp(a[1], b[1])) + methods = list.sorted(obj.methods.iteritems(), key=itemgetter(1)) for name, lineno in methods: if name != "__path__": print " def", name, lineno |