mirror of https://github.com/astral-sh/ruff
Handle unary `not` on instances by calling the `__bool__` dunder. ## Test Plan Added a new test case with some examples from these resources: - https://docs.python.org/3/library/stdtypes.html#truth-value-testing - <https://docs.python.org/3/reference/datamodel.html#object.__len__> - <https://docs.python.org/3/reference/datamodel.html#object.__bool__> --------- Co-authored-by: Carl Meyer <carl@astral.sh> |
||
|---|---|---|
| .. | ||
| integers.md | ||
| invert_add_usub.md | ||
| not.md | ||