考虑以下代码:
testvar: bool = True if testvar: foo: str = '' # Statements that do not affect value of testvar if testvar: bar: str = foo
我试过的任何 linter 都会抱怨
foo
此外,避免警告的推荐方法是什么?