basedpyright
basedpyright copied to clipboard
unused variable/parameter false negative when it's reassigned before it's used
def f(a: int): # no nerror
a = 1
print(a)
https://basedpyright.com/?typeCheckingMode=all&code=CYUwZgBGAUCGBcUA2B7WAXAlPAUBfEsEAvBAIx4EAOATgJYB26cmQA
and
def f():
a = 1 # no error
a = 2
huh???? it's literally used
fail, it's reassigned first, the passed value is never used
oh, that's the same with unused variables too. https://github.com/microsoft/pyright/issues/8806