Skip to content

Incorrect type annotation for Union #276

Description

@hugary1995

I got something like

Number: typing._UnionGenericAlias  # value = typing.Union[int, float, bool]

where I expect the correct annotation to be either

Number = typing.Union[int, float, bool]

or PEP 613-style:

Number: TypeAlias = int | float | bool

I'm using version 2.5.5.

Please let me know if I was doing something wrong, or point me to the relevant source code so that I can make a PR. Thanks!

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

    bugSomething isn't working

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions