Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Track subscripts and multi-assignments by analysing nested type hints #20

Open
felix-hilden opened this issue Sep 30, 2021 · 1 comment
Labels
enhancement New feature or request

Comments

@felix-hilden
Copy link
Owner

From #5: we have the machinery in place to track subscripts and unpacking assignments by analysing type hints that are nested tuples or lists of simple types:

class A:
    attr: int = 3

def foo() -> List[A]:
    pass

def bar() -> Tuple[A, A]:
    pass

# example code
a = lib.foo()[0]
a.attr  # properly linked
b, c = lib.bar()  # b and c linked to A

I'm not sure what to do with other than constant integer subscripts though.

@felix-hilden felix-hilden added the enhancement New feature or request label Sep 30, 2021
@felix-hilden
Copy link
Owner Author

The subscripts might also be slices, so we definitely need a way to recognise them or ignore cases that are too complex.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant