mirror of
https://github.com/python/cpython.git
synced 2025-08-31 05:58:33 +00:00
bpo-36218: Fix handling of heterogeneous values in list.sort (GH-12209)
This commit is contained in:
parent
9dcc095f45
commit
dd5417afcf
3 changed files with 29 additions and 11 deletions
|
@ -373,6 +373,11 @@ class TestOptimizedCompares(unittest.TestCase):
|
|||
check_against_PyObject_RichCompareBool(self, [float('nan')]*100)
|
||||
check_against_PyObject_RichCompareBool(self, [float('nan') for
|
||||
_ in range(100)])
|
||||
|
||||
def test_not_all_tuples(self):
|
||||
self.assertRaises(TypeError, [(1.0, 1.0), (False, "A"), 6].sort)
|
||||
self.assertRaises(TypeError, [('a', 1), (1, 'a')].sort)
|
||||
self.assertRaises(TypeError, [(1, 'a'), ('a', 1)].sort)
|
||||
#==============================================================================
|
||||
|
||||
if __name__ == "__main__":
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue