bpo-42345: Fix hash implementation of typing.Literal (GH-23383) · python/cpython@1b54077 (original) (raw)

`@@ -569,6 +569,11 @@ def test_equal(self):

`

569

569

`self.assertEqual(Literal[1, 2], Literal[2, 1])

`

570

570

`self.assertEqual(Literal[1, 2, 3], Literal[1, 2, 3, 3])

`

571

571

``

``

572

`+

def test_hash(self):

`

``

573

`+

self.assertEqual(hash(Literal[1]), hash(Literal[1]))

`

``

574

`+

self.assertEqual(hash(Literal[1, 2]), hash(Literal[2, 1]))

`

``

575

`+

self.assertEqual(hash(Literal[1, 2, 3]), hash(Literal[1, 2, 3, 3]))

`

``

576

+

572

577

`def test_args(self):

`

573

578

`self.assertEqual(Literal[1, 2, 3].args, (1, 2, 3))

`

574

579

`self.assertEqual(Literal[1, 2, 3, 3].args, (1, 2, 3))

`