diff options
author | Jelle Zijlstra <jelle.zijlstra@gmail.com> | 2025-05-25 10:26:39 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2025-05-25 17:26:39 +0000 |
commit | 57fef27cfc2bdfc1e3a65ef8c8a760198d15b14d (patch) | |
tree | 3f3bcaea9b560b56838e63b4937912cd90b9dc57 /Python/stackrefs.c | |
parent | b51b08a0a5fedde4f74e4cc338b8b5ad9656ad50 (diff) | |
download | cpython-57fef27cfc2bdfc1e3a65ef8c8a760198d15b14d.tar.gz cpython-57fef27cfc2bdfc1e3a65ef8c8a760198d15b14d.zip |
gh-133960: Improve typing.evaluate_forward_ref (#133961)
As explained in #133960, this removes most of the behavior differences with ForwardRef.evaluate.
The remaining difference is about recursive evaluation of forwardrefs; this is practically useful
in cases where an annotation refers to a type alias that itself is string-valued.
This also improves several edge cases that were previously not handled optimally. For example,
the function now takes advantage of the partial evaluation behavior of ForwardRef.evaluate() to
evaluate more ForwardRefs in the FORWARDREF format.
This also fixes #133959 as a side effect, because the buggy behavior in #133959 derives from
evaluate_forward_ref().
Diffstat (limited to 'Python/stackrefs.c')
0 files changed, 0 insertions, 0 deletions