summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_typing.py
diff options
context:
space:
mode:
authorSerhiy Storchaka <storchaka@gmail.com>2021-10-31 08:22:16 (GMT)
committerGitHub <noreply@github.com>2021-10-31 08:22:16 (GMT)
commit634984d7dbdd91e0a51a793eed4d870e139ae1e0 (patch)
tree18d88dc13135d6a8cae515519144525e91efabe7 /Lib/test/test_typing.py
parentaad48062ef8f983fbb95f9dc0c3c3cef9c89df02 (diff)
downloadcpython-634984d7dbdd91e0a51a793eed4d870e139ae1e0.zip
cpython-634984d7dbdd91e0a51a793eed4d870e139ae1e0.tar.gz
cpython-634984d7dbdd91e0a51a793eed4d870e139ae1e0.tar.bz2
bpo-45679: Fix caching of multi-value typing.Literal (GH-29334)
Literal[True, 2] is no longer equal to Literal[1, 2].
Diffstat (limited to 'Lib/test/test_typing.py')
-rw-r--r--Lib/test/test_typing.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/Lib/test/test_typing.py b/Lib/test/test_typing.py
index b1414dc..90d6bea 100644
--- a/Lib/test/test_typing.py
+++ b/Lib/test/test_typing.py
@@ -714,6 +714,8 @@ class LiteralTests(BaseTestCase):
self.assertNotEqual(Literal[True], Literal[1])
self.assertNotEqual(Literal[1], Literal[2])
self.assertNotEqual(Literal[1, True], Literal[1])
+ self.assertNotEqual(Literal[1, True], Literal[1, 1])
+ self.assertNotEqual(Literal[1, 2], Literal[True, 2])
self.assertEqual(Literal[1], Literal[1])
self.assertEqual(Literal[1, 2], Literal[2, 1])
self.assertEqual(Literal[1, 2, 3], Literal[1, 2, 3, 3])
@@ -4963,6 +4965,8 @@ class SpecialAttrsTests(BaseTestCase):
typing.Concatenate[Any, SpecialAttrsP]: 'Concatenate',
typing.Final[Any]: 'Final',
typing.Literal[Any]: 'Literal',
+ typing.Literal[1, 2]: 'Literal',
+ typing.Literal[True, 2]: 'Literal',
typing.Optional[Any]: 'Optional',
typing.TypeGuard[Any]: 'TypeGuard',
typing.Union[Any]: 'Any',