basedpyright
basedpyright copied to clipboard
`reportPossiblyUnboundVariable` false negative on assignments to instance attribute
Code sample in basedpyright playground
class Foo:
def __init__(self) -> None:
if bool():
a = 1
a # "a" is possibly unbound (reportPossiblyUnboundVariable)
if bool():
self.a = 1
self.a # no error
maybe related?: #682