False positive for undefined variable #977
Labels
bug
Something isn't working
fixed in next version (main)
A fix has been implemented and will appear in an upcoming version
Environment data
Expected behaviour
Given a module
test_module
in the python path defining an objecttest_object
the following code correctly definesto
as a global variable of the current module accessible from the scope of functionf
and referencingtest_object
.Actual behaviour
Pylance reports undefined variable for
to
. Removing theglobal
declaration "fixes" it, but I wantto
to:f
invocation, not before.Besides it's valid code, despite the somewhat convoluted use case.
The text was updated successfully, but these errors were encountered: