Gar*_*ary 4 python refactoring boolean lint pylint
I have some code that causes pylint to complain:
The if statement can be replaced with 'var = bool(test)' (simplifiable-if-statement)`
The code (with obfuscated variable names) is below.
A = True
B = 1
C = [1]
D = False
E = False
if A and B in C:
D = True
else:
E = True
print(D, E)
Run Code Online (Sandbox Code Playgroud)
How can this be simplified so that pylint does not throw any errors? I don't quite understand how bool() can be used for this. I know it converts any value to a Boolean value, but I don't know how it can be applied here.