mirror of
https://github.com/python/cpython.git
synced 2025-10-09 16:34:44 +00:00
Guido grants a Christmas wish:
sorted() becomes a regular function instead of a classmethod.
This commit is contained in:
parent
df38ea9c29
commit
64958a15d7
15 changed files with 120 additions and 138 deletions
|
@ -263,7 +263,7 @@ class OperatorTestCase(unittest.TestCase):
|
|||
inventory = [('apple', 3), ('banana', 2), ('pear', 5), ('orange', 1)]
|
||||
getcount = operator.itemgetter(1)
|
||||
self.assertEqual(map(getcount, inventory), [3, 2, 5, 1])
|
||||
self.assertEqual(list.sorted(inventory, key=getcount),
|
||||
self.assertEqual(sorted(inventory, key=getcount),
|
||||
[('orange', 1), ('banana', 2), ('apple', 3), ('pear', 5)])
|
||||
|
||||
def test_main():
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue