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.
Implement tracking variable values by location #682
Closed
Description
For better intellisense we need to track variable assignment locations so in
x = 1
x. # yields completions for int
x = 's'
x. # yields completions for str
see also #668 for isinstance
so
from typing import Union, List
class Foo: pass
class Bar: pass
FB = Union[Foo, List[Bar]]
def do(fb: FB):
if isinstance(fb, list):
fb. # completions for list
return fb[0]
else:
fb. # completions for Foo