Describe the bug
var defined in a function scope in the screenshot below is accessed but reported as not.
To Reproduce
N/A
Expected behavior
N/A
Screenshots or Code

def test():
var = 1
lambda _=var: ...
# However, no error in the module scope
foo = 0
lambda _=foo: ...
VS Code extension or command-line
vim coc-pyright with pyright 1.1.53
Additional context
N/A
Thanks for the bug report. This will be fixed in the next version of Pyright and Pylance.
This is now fixed in Pyright 1.1.54, which I just published. It will also be included in the next release of Pylance.
Most helpful comment
This is now fixed in Pyright 1.1.54, which I just published. It will also be included in the next release of Pylance.