Back to Ruff

error: [unsupported-bool-conversion] "Boolean conversion is not supported for type `NotBoolable`"

crates/ty_python_semantic/resources/mdtest/expression/assert.md

0.15.12237 B
Original Source

Condition with object that implements __bool__ incorrectly

py
class NotBoolable:
    __bool__: int = 3

# error: [unsupported-bool-conversion] "Boolean conversion is not supported for type `NotBoolable`"
assert NotBoolable()