diff options
author | Dong-hee Na <donghee.na@python.org> | 2021-10-16 15:12:58 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-10-16 15:12:58 (GMT) |
commit | 15ad52fbf607b6ccec44a38a8a32a5f1fad635ee (patch) | |
tree | 242594a0688416f2176373afd1bcee36795e2889 /Lib/test/test_typing.py | |
parent | 4ecd119b007cb766b8bede2dc78b70d29cd932dd (diff) | |
download | cpython-15ad52fbf607b6ccec44a38a8a32a5f1fad635ee.zip cpython-15ad52fbf607b6ccec44a38a8a32a5f1fad635ee.tar.gz cpython-15ad52fbf607b6ccec44a38a8a32a5f1fad635ee.tar.bz2 |
bpo-45489: Update ForwardRef to support | operator. (GH-28991)
Diffstat (limited to 'Lib/test/test_typing.py')
-rw-r--r-- | Lib/test/test_typing.py | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/Lib/test/test_typing.py b/Lib/test/test_typing.py index 38397a0..032fe91 100644 --- a/Lib/test/test_typing.py +++ b/Lib/test/test_typing.py @@ -2903,6 +2903,12 @@ class ForwardRefTests(BaseTestCase): self.assertNotEqual(gth(Loop, globals())['attr'], Final[int]) self.assertNotEqual(gth(Loop, globals())['attr'], Final) + def test_or(self): + X = ForwardRef('X') + # __or__/__ror__ itself + self.assertEqual(X | "x", Union[X, "x"]) + self.assertEqual("x" | X, Union["x", X]) + class OverloadTests(BaseTestCase): |