Does anyone use Microsoft's Pylance static type checker in VSCode and know how to disable this type of error.
For example, given the following snippet
Code:
# noinspection PyUnreachableCode
if False :
load_translations = _ = ngettext = lambda x=None, y=None, z=None: x
load_translations()
The first few lines are enough to stop ruff and mypy from complaining about the method call but not Pylance which displays an error like
"load_translations" is not defined Pylance (reportUndefinedVariable)
I know I have three options
1) Disable pylance
2) Disable this type of error across the whole project
3) Pollute the codebase by adding "# type: ignore" to hundreds of lines.
But I would prefer not to have do any of these and was wondering if there was a better way?