diff options
author | Ken Jin <28750310+Fidget-Spinner@users.noreply.github.com> | 2020-12-29 04:06:19 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-12-28 12:06:19 -0800 |
commit | 4140f10a16f06c32fd49f9e21fb2a53abe7357f0 (patch) | |
tree | ec6e4a38d4d03b786196e86592b663a78b774493 /Lib/test/test_typing.py | |
parent | a9621bb301dba44494e81edc00e3a3b62c96af26 (diff) | |
download | cpython-git-4140f10a16f06c32fd49f9e21fb2a53abe7357f0.tar.gz |
bpo-42740: Fix get_args for PEP 585 collections.abc.Callable (GH-23963)
PR 1/2. Needs backport to 3.9.
Diffstat (limited to 'Lib/test/test_typing.py')
-rw-r--r-- | Lib/test/test_typing.py | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/Lib/test/test_typing.py b/Lib/test/test_typing.py index c340c8a898..3dcc31fe5b 100644 --- a/Lib/test/test_typing.py +++ b/Lib/test/test_typing.py @@ -3048,6 +3048,11 @@ class GetUtilitiesTestCase(TestCase): self.assertEqual(get_args(Callable), ()) self.assertEqual(get_args(list[int]), (int,)) self.assertEqual(get_args(list), ()) + self.assertEqual(get_args(collections.abc.Callable[[int], str]), ([int], str)) + self.assertEqual(get_args(collections.abc.Callable[..., str]), (..., str)) + self.assertEqual(get_args(collections.abc.Callable[[], str]), ([], str)) + self.assertEqual(get_args(collections.abc.Callable[[int], str]), + get_args(Callable[[int], str])) class CollectionsAbcTests(BaseTestCase): |