sublimelsp / LSP-pyright

Python support for Sublime's LSP plugin provided through microsoft/pyright.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Unbound variable

rjunior8 opened this issue · comments

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!

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