The analyzer can verify Any_to_bool preconditions (✅ pass) but cannot resolve the resulting bool(x) == y equality check (❓ unknown) for any type.
Affected assertions:
assert bool(None) == False
assert bool(True) == True, assert bool(False) == False
assert bool(0) == False, assert bool(1) == True, assert bool(-1) == True
assert bool(0.0) == False, assert bool(1.5) == True, assert bool(-0.0) == False
assert bool("") == False, assert bool("x") == True
assert bool([]) == False, assert bool([1]) == True
assert bool({}) == False, assert bool({"a": 1}) == True
All of these are valid Python and should verify as ✅ pass.
Related: #934
The analyzer can verify
Any_to_boolpreconditions (✅ pass) but cannot resolve the resultingbool(x) == yequality check (❓ unknown) for any type.Affected assertions:
assert bool(None) == Falseassert bool(True) == True,assert bool(False) == Falseassert bool(0) == False,assert bool(1) == True,assert bool(-1) == Trueassert bool(0.0) == False,assert bool(1.5) == True,assert bool(-0.0) == Falseassert bool("") == False,assert bool("x") == Trueassert bool([]) == False,assert bool([1]) == Trueassert bool({}) == False,assert bool({"a": 1}) == TrueAll of these are valid Python and should verify as ✅ pass.
Related: #934