ruff/crates/red_knot_python_semantic/resources/mdtest/unary
Shaygan Hooshyari 924741cb11
[red-knot] Infer unary not operation for instances (#13827)
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>
2024-11-13 23:31:36 +00:00
..
integers.md [red-knot] Autoformat mdtest Python snippets using blacken-docs (#13809) 2024-10-19 15:57:06 +01:00
invert_add_usub.md [red-knot] Infer unary not operation for instances (#13827) 2024-11-13 23:31:36 +00:00
not.md [red-knot] Infer unary not operation for instances (#13827) 2024-11-13 23:31:36 +00:00