mirror of
https://github.com/astral-sh/ruff
synced 2026-01-23 14:30:53 -05:00
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>
Markdown files within the mdtest/ subdirectory are tests of type inference and type checking;
executed by the tests/mdtest.rs integration test.
See crates/red_knot_test/README.md for documentation of this test format.