Skip to content

Analyzer cannot resolve bool(x) == y equality assertions #945

@keyboardDrummer-bot

Description

@keyboardDrummer-bot

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions