defineConstant not working
Describe the bug
Configuration setting "defineConstant" not working.
Pyright's reachability analysis dosent seen to be affect by it.

To Reproduce
- Add following setting in pyrightconfig.json
"defineConstant": {
"DEBUG": false,
}
- Add following code in projcect script file
DEBUG = False
if DEBUG:
a = 1
print(a)
- Pyright still think statments under "if DEBUG:" is rechable (color's not changed).
Expected behavior Statements under "if Debug:" become unreachable.
Version of Pylance language server is 2022.7.30

I'm able to repro the problem you're seeing with pylance. It didn't show up in any of our internal testing or with our unit tests because it works fine in in debug mode. It appears only in production mode, where we use background threads for processing. This will be fixed in the next release.
I'm able to repro the problem you're seeing with pylance. It didn't show up in any of our internal testing or with our unit tests because it works fine in in debug mode. It appears only in production mode, where we use background threads for processing. This will be fixed in the next release.
Thx for the reply, cant wait to see it fixed!
This is addressed in pyright 1.1.262, which I just published. It will also be included in a future version of pylance.