mirror of
https://github.com/python/cpython.git
synced 2026-01-27 05:05:50 +00:00
gh-95173: Add a regression test for sorting tuples containing None (GH-95464)
(cherry picked from commit c0cd79021951b3ab10804d42b3963b9fb1a66be7) Co-authored-by: Jacob Walls <jacobtylerwalls@gmail.com>
This commit is contained in:
parent
3192fd7683
commit
76d83b1dfe
@ -378,6 +378,12 @@ class TestOptimizedCompares(unittest.TestCase):
|
||||
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)
|
||||
|
||||
def test_none_in_tuples(self):
|
||||
expected = [(None, 1), (None, 2)]
|
||||
actual = sorted([(None, 2), (None, 1)])
|
||||
self.assertEqual(actual, expected)
|
||||
|
||||
#==============================================================================
|
||||
|
||||
if __name__ == "__main__":
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user