mirror of
https://github.com/python/cpython.git
synced 2025-12-08 06:10:17 +00:00
[3.14] gh-138891: fix star-unpack in get_annotations (GH-138951) (#140384)
gh-138891: fix star-unpack in get_annotations (GH-138951)
(cherry picked from commit c6be6e4537)
Co-authored-by: Christoph Walcher <christoph-wa@gmx.de>
This commit is contained in:
parent
8e93f6e203
commit
62f44dda1c
3 changed files with 21 additions and 9 deletions
|
|
@ -787,6 +787,12 @@ def test_stringized_annotations_in_empty_module(self):
|
|||
self.assertEqual(get_annotations(isa2, eval_str=True), {})
|
||||
self.assertEqual(get_annotations(isa2, eval_str=False), {})
|
||||
|
||||
def test_stringized_annotations_with_star_unpack(self):
|
||||
def f(*args: *tuple[int, ...]): ...
|
||||
self.assertEqual(get_annotations(f, eval_str=True),
|
||||
{'args': (*tuple[int, ...],)[0]})
|
||||
|
||||
|
||||
def test_stringized_annotations_on_wrapper(self):
|
||||
isa = inspect_stringized_annotations
|
||||
wrapped = times_three(isa.function)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue