Skip to content
This repository was archived by the owner on Apr 14, 2022. It is now read-only.
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

Description

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.

Activity

  1. jakebailey commented on Feb 21, 2019

    @jakebailey
    MemberAuthor

    Related: #207

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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions