Skip to content
This repository was archived by the owner on Apr 14, 2022. It is now read-only.

Convert lists/dicts/etc with consistent types to specific types #605

Open
jakebailey opened this issue Feb 13, 2019 · 1 comment
Open

Convert lists/dicts/etc with consistent types to specific types #605

jakebailey opened this issue Feb 13, 2019 · 1 comment

Comments

@jakebailey
Copy link
Member

Examples:

a = [1, 2, 3]         # we show "list", but could be "list[int]"
b = [[1, 2], [3, 4]]  # we show "list", but could be "list[list[int]]"
s = {1, 2, 3}         # we show "set", but could be "set[int]"
d = {1: "1", 2: "2"}  # we show "dict", but could be "dict[int, str]"

This may be something done in the analysis, or for tooltips only. The former may provide better analysis in other places where we want to know that information. The latter may be more simple to do, as it'd be a check over the values to see if they're the same before displaying.

We still store per-index types under the hood (i.e. [1, "2"][0]. will show int completion), so the latter would seem to make more sense, but given that the analysis gets discarded and redone when a file changes, the former would probably work out as well.

@jakebailey
Copy link
Member Author

Related: #207

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant