-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Closed
Labels
as designedNot a bug, working as intendedNot a bug, working as intendedenhancement requestNew feature or requestNew feature or request
Description
When variables are conditionally declared, then pyright may show "possibly unbound" error, even though ideally it should be able to infer that the variable won't be unbound.
DEFINE_X = True
if(DEFINE_X):
x = 3
# ...
# Code that does not touch DEFINE_X
# ...
if(DEFINE_X):
y = x + 3 # This line is highlighted as "x possibly unbound"
# There is enough information in the code to ensure that
# x is not unbound at this time. Perhaps such false positive
# error messages can be avoided?
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
as designedNot a bug, working as intendedNot a bug, working as intendedenhancement requestNew feature or requestNew feature or request