SIGN IN SIGN UP

gh-119180: Avoid going through AST and eval() when possible in annotationlib (#124337)

Often, ForwardRefs represent a single simple name. In that case, we
can avoid going through the overhead of creating AST nodes and code
objects and calling eval(): we can simply look up the name directly
in the relevant namespaces.

Co-authored-by: Victor Stinner <vstinner@python.org>
J
Jelle Zijlstra committed
17a544b257ee3aeaa525350717ee56fd409d9c08
Parent: 9d8f2d8
Committed by GitHub <noreply@github.com> on 9/25/2024, 9:14:03 PM