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
Annotated with forward references does not partially evaluate #137706
Annotated raises a TypeError as it thinks the _Stringifier is an unpacked typevartuple
call_annotate_function falls back to the all-stringifiers backup mode which makes the whole thing a ForwardRef
I think the solution for Annotated not partially evaluating is probably to make typing._is_unpacked_typevartuple check that the value is True rather than truthy.
One reason why this might matter - the exception that occurs internally can also prevent other annotations from partially evaluating:
Activity
JelleZijlstra commentedon Aug 13, 2025
Nice catch. Yes, checking for
is Truesounds like the right solution.gh-137706: make typing._is_unpacked_typevartuple check for `True` ins…
pythongh-137706: make typing._is_unpacked_typevartuple check for `Tru…
pythongh-137706: make typing._is_unpacked_typevartuple check for `Tru…
[3.14] gh-137706: make typing._is_unpacked_typevartuple check for `Tr…
Refactor C-implemented typing aliases and introduce pycore_typing.h
Refactor C-implemented typing aliases and introduce pycore_typing.h