Skip to content

inspect.signature throws exceptions when things are imported in TYPE_CHECKING #157311

Description

@FabriceSalvaire

Bug report

Bug description:

I am trying to generate stub files but inspect.signature throws exceptions when things are imported in TYPE_CHECKING. I tried to set globals but it doesn't help.
I don't see any hints in https://docs.python.org/3/library/inspect.html#inspect.signature and https://docs.python.org/3/library/annotationlib.html#annotationlib.get_annotations

CPython versions tested on:

3.15

Operating systems tested on:

Linux

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    type-bugAn unexpected behavior, bug, or error

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions