Bug report
Bug description:
The implementation of annotationlib.ForwardRef.evaluate handles its type_params argument in a complex yet incorrect way. Fixing this unfortunately leads to some test failures in typing.get_type_hints() because it does additional confusing things to the globals and locals. Still, I think we should fix the behavior of the new public .evaluate() method.
CPython versions tested on:
CPython main branch
Operating systems tested on:
No response
Linked PRs
- gh-137226: Fix behavior of ForwardRef.evaluate with type_params #137227
- [3.14] gh-137226: Fix behavior of ForwardRef.evaluate with type_params (GH-137227) #137709
- gh-137226: Fix get_type_hints() on generic TypedDict with stringified annotations #138953
- [3.14] gh-137226: Fix get_type_hints() on generic TypedDict with stringified annotations (GH-138953) #138989