DetachHead / basedpyright

pyright fork with various type checking improvements, improved vscode support and pylance features built into the language server
http://docs.basedpyright.com/
Other
613 stars 13 forks source link

remember previous conditions when narrowing and bounding #406

Closed DetachHead closed 3 weeks ago

DetachHead commented 3 weeks ago
def foo(value: bool):
    if value:
        a = 1
    if value:
        print(a) # error: possibly unbound
KotlinIsland commented 3 weeks ago

Need to consider the dependencies of the condition mutating:

def foo(value: bool):
    if value:
        a = 1
    if value:
        print(a) # all good
    value = bool()
    if value:
        print(a) # error: possibly unbound
DetachHead commented 3 weeks ago

Duplicate of #103