You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
inspect.get_annotations(eval_str=True) raises SyntaxError for PEP-646 unpacked tuple annotation *tuple[...] #138891
inspect.get_annotations should behave consistently and not raise SyntaxError.
Possible Resolution
Make inspect.get_annotations(eval_str=True) aware of this special case and transform annotation strings of the form *tuple[...] into typing.Unpack[tuple[...]] before evaluation, similar to what typing.get_type_hints does.
Activity
brianschubert commentedon Sep 14, 2025
cc @JelleZijlstra
pythongh-138891: fix star-unpack in get_annotations
pythongh-138891: fix star-unpack in get_annotations
gh-138891: fix star-unpack in get_annotations (#138951)
pythongh-138891: fix star-unpack in get_annotations (pythonGH-138951)
[3.14] gh-138891: fix star-unpack in get_annotations (GH-138951) (#14…
pythongh-138891: fix star-unpack in get_annotations (python#138951)
[3.13] pythongh-138891: fix star-unpack in get_annotations (pythonGH-…
[3.13] pythongh-138891: fix star-unpack in get_annotations (pythonGH-…
[3.13] gh-138891: fix star-unpack in get_annotations (GH-138951) (#14…