You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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
The text was updated successfully, but these errors were encountered:
The reason for the overload is that in the first instances type object references have the type Overloaded with is_type_object() true, while for t2 the type is TypeType. These types don't behave exactly the same, so displaying the exact same type wouldn't be perfect either. The current behavior is not very good either, since we lose information that the type refers to a type object specifically, not just any callable. I'm not sure what's the best option here -- one option would be to use type[Overload(...)] instead of just Overload(...), but that could be confusing as well.
Consider this example:
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 getType[builtins.int]
My Environment
mypy 0.961 (compiled: no)
CPython 3.10.4
The text was updated successfully, but these errors were encountered: