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
{{ message }}
This repository was archived by the owner on Apr 14, 2022. It is now read-only.
Repository navigation
This repository was archived by the owner on Apr 14, 2022. It is now read-only.
Consider showing type information in PEP 484 format #346
When we show list[int, int], what we mean is that it's a list with two items, both of type int. However, if I go write a function which would accept this variable, I would actually write:
These two syntaxes are nearly identical, and I think that even though the current behavior is more "exact", the conflict between the official type hint syntax may cause confusion as we improve our support for typing/generics.
I think it's worth figuring out if we should stop including the extra info we have in its current form, and maybe try to figure out some better way to show the info that doesn't conflict with the standard way of writing types in PEP 484.
In the new language server, things are shown much more closely (with hints, identically) to PEP 484/typing.
The original example of foo = [[1, 2], [3, 4]] just shows list instead (as it is a specific instance of the real list type. There may be some loss or tooltip change that can be made to better display lists of known-consistent types, which I've opened as #605.
Activity
jakebailey commentedon Feb 13, 2019
In the new language server, things are shown much more closely (with hints, identically) to PEP 484/typing.
The original example of
foo = [[1, 2], [3, 4]]just showslistinstead (as it is a specific instance of the reallisttype. There may be some loss or tooltip change that can be made to better display lists of known-consistent types, which I've opened as #605.