◐ Shell
clean mode source ↗

gh-119180: Fix annotationlib.ForwardRef.evaluate with no globals by JelleZijlstra · Pull Request #124326 · python/cpython

@JelleZijlstra

…onlib module scope

We were sometimes passing None as the globals argument to eval(), which makes it
inherit the globals from the calling scope. Instead, ensure that globals is always
non-None. The test was passing accidentally because I passed "annotationlib" as a
module object; fix that. Also document the parameters to ForwardRef() and remove
two unused private ones.