mirror of
https://github.com/python/cpython.git
synced 2025-07-24 03:35:53 +00:00
bpo-44490: Improve typing module compatibility with types.Union (GH-27048) (#27222)
(cherry picked from commit bf89ff96e6
)
Co-authored-by: Yurii Karabas <1998uriyyo@gmail.com>
This commit is contained in:
parent
37bdd2221c
commit
a272164959
5 changed files with 40 additions and 7 deletions
|
@ -473,7 +473,7 @@ class GrammarTests(unittest.TestCase):
|
|||
def test_var_annot_module_semantics(self):
|
||||
self.assertEqual(test.__annotations__, {})
|
||||
self.assertEqual(ann_module.__annotations__,
|
||||
{1: 2, 'x': int, 'y': str, 'f': typing.Tuple[int, int]})
|
||||
{1: 2, 'x': int, 'y': str, 'f': typing.Tuple[int, int], 'u': int | float})
|
||||
self.assertEqual(ann_module.M.__annotations__,
|
||||
{'123': 123, 'o': type})
|
||||
self.assertEqual(ann_module2.__annotations__, {})
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue