Skip to content

Inconsistency in reveal_type(some_type) #13062

Open
@denballakh

Description

@denballakh

Consider this example:

t1 = int
t2: type[int] = t1

reveal_type(int) # huge overload
reveal_type(t1) # huge overload
reveal_type(t2) # Type[builtins.int]

I expect get the same result in all three reveal_type's, but in two cases i get huge overload: Overload(def (Union[builtins.str, builtins.bytes, array.array[Any], mmap.mmap, ctypes._CData, pickle.PickleBuffer, typing.SupportsInt, typing_extensions.SupportsIndex, _typeshed.SupportsTrunc] =) -> builtins.int, def (Union[builtins.str, builtins.bytes], base: typing_extensions.SupportsIndex) -> builtins.int), and in one case i get Type[builtins.int]

My Environment

  • mypy 0.961 (compiled: no)
  • no command-line flags, no config file
  • CPython 3.10.4
  • Windows 10

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions