New submission from Reinhard Engel <nc-enge...@netcologne.de>: # Strange sort error # lst1 and lst 2 produce different results, but should be same # lst1 should sort by length of items, but doesn't, lst2 does!
lst0 = ['ab-get-ratings-max', 'ab-get-ratings-min', 'ab-rate-position', 'accum', 'add-cops', 'add-new-dice', 'add-passing-move', 'add-plants', 'add-two', 'add-widget'] print lst0 lst1 = sorted(lst0, lambda x, y: len(y) > len(x)) print lst1 lst2 = sorted(lst0, lambda x, y: len(y) - len(x)) print lst2 ---------- messages: 138322 nosy: rengel priority: normal severity: normal status: open title: Strange sort error type: behavior _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue12334> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com