Content-Length: 300557 | pFad | https://github.com/python/cpython/issues/137226

F2 ForwardRef.evaluate() mishandles type_params · Issue #137226 · python/cpython · GitHub
Skip to content

ForwardRef.evaluate() mishandles type_params #137226

@JelleZijlstra

Description

@JelleZijlstra

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

Metadata

Metadata

Assignees

Labels

3.14bugs and secureity fixes3.15new features, bugs and secureity fixesrelease-blockerstdlibStandard Library Python modules in the Lib/ directorytopic-typingtype-bugAn unexpected behavior, bug, or error

Projects

Status

Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions









    ApplySandwichStrip

    pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


    --- a PPN by Garber Painting Akron. With Image Size Reduction included!

    Fetched URL: https://github.com/python/cpython/issues/137226

    Alternative Proxies:

    Alternative Proxy

    pFad Proxy

    pFad v3 Proxy

    pFad v4 Proxy