Unbound variable
rjunior8 opened this issue · comments
Robson Júnior commented
How to configure to show the following message?
def func():
if True:
your_variable = 1
return your_variable
"your_variable" is possibly unbound
Thank you!
Rafał Chłodnicki commented
Pyright is smart enough to know that in this specific case it will be always be bound so it's not reporting anything.
It will report in this case for example:
x = True
def func():
if x:
your_variable = 1
return your_variable