---
source: crates/ruff_linter/src/rules/pylint/mod.rs
---
PLC2801 [*] Unnecessary dunder call to `__add__`. Use `+` operator.
 --> unnecessary_dunder_call.py:4:7
  |
3 | a = 2
4 | print((3.0).__add__(4.0))  # PLC2801
  |       ^^^^^^^^^^^^^^^^^^
5 | print((3.0).__sub__(4.0))  # PLC2801
6 | print((3.0).__mul__(4.0))  # PLC2801
  |
help: Use `+` operator
  |
3 | a = 2
  - print((3.0).__add__(4.0))  # PLC2801
4 + print(3.0 + 4.0)  # PLC2801
5 | print((3.0).__sub__(4.0))  # PLC2801
  |
note: This is an unsafe fix and may change runtime behavior

PLC2801 [*] Unnecessary dunder call to `__sub__`. Use `-` operator.
 --> unnecessary_dunder_call.py:5:7
  |
3 | a = 2
4 | print((3.0).__add__(4.0))  # PLC2801
5 | print((3.0).__sub__(4.0))  # PLC2801
  |       ^^^^^^^^^^^^^^^^^^
6 | print((3.0).__mul__(4.0))  # PLC2801
7 | print((3.0).__truediv__(4.0))  # PLC2801
  |
help: Use `-` operator
  |
4 | print((3.0).__add__(4.0))  # PLC2801
  - print((3.0).__sub__(4.0))  # PLC2801
5 + print(3.0 - 4.0)  # PLC2801
6 | print((3.0).__mul__(4.0))  # PLC2801
  |
note: This is an unsafe fix and may change runtime behavior

PLC2801 [*] Unnecessary dunder call to `__mul__`. Use `*` operator.
 --> unnecessary_dunder_call.py:6:7
  |
4 | print((3.0).__add__(4.0))  # PLC2801
5 | print((3.0).__sub__(4.0))  # PLC2801
6 | print((3.0).__mul__(4.0))  # PLC2801
  |       ^^^^^^^^^^^^^^^^^^
7 | print((3.0).__truediv__(4.0))  # PLC2801
8 | print((3.0).__floordiv__(4.0))  # PLC2801
  |
help: Use `*` operator
  |
5 | print((3.0).__sub__(4.0))  # PLC2801
  - print((3.0).__mul__(4.0))  # PLC2801
6 + print(3.0 * 4.0)  # PLC2801
7 | print((3.0).__truediv__(4.0))  # PLC2801
  |
note: This is an unsafe fix and may change runtime behavior

PLC2801 [*] Unnecessary dunder call to `__truediv__`. Use `/` operator.
 --> unnecessary_dunder_call.py:7:7
  |
5 | print((3.0).__sub__(4.0))  # PLC2801
6 | print((3.0).__mul__(4.0))  # PLC2801
7 | print((3.0).__truediv__(4.0))  # PLC2801
  |       ^^^^^^^^^^^^^^^^^^^^^^
8 | print((3.0).__floordiv__(4.0))  # PLC2801
9 | print((3.0).__mod__(4.0))  # PLC2801
  |
help: Use `/` operator
  |
6 | print((3.0).__mul__(4.0))  # PLC2801
  - print((3.0).__truediv__(4.0))  # PLC2801
7 + print(3.0 / 4.0)  # PLC2801
8 | print((3.0).__floordiv__(4.0))  # PLC2801
  |
note: This is an unsafe fix and may change runtime behavior

PLC2801 [*] Unnecessary dunder call to `__floordiv__`. Use `//` operator.
  --> unnecessary_dunder_call.py:8:7
   |
 6 | print((3.0).__mul__(4.0))  # PLC2801
 7 | print((3.0).__truediv__(4.0))  # PLC2801
 8 | print((3.0).__floordiv__(4.0))  # PLC2801
   |       ^^^^^^^^^^^^^^^^^^^^^^^
 9 | print((3.0).__mod__(4.0))  # PLC2801
10 | print((3.0).__eq__(4.0))  # PLC2801
   |
help: Use `//` operator
  |
7 | print((3.0).__truediv__(4.0))  # PLC2801
  - print((3.0).__floordiv__(4.0))  # PLC2801
8 + print(3.0 // 4.0)  # PLC2801
9 | print((3.0).__mod__(4.0))  # PLC2801
  |
note: This is an unsafe fix and may change runtime behavior

PLC2801 [*] Unnecessary dunder call to `__mod__`. Use `%` operator.
  --> unnecessary_dunder_call.py:9:7
   |
 7 | print((3.0).__truediv__(4.0))  # PLC2801
 8 | print((3.0).__floordiv__(4.0))  # PLC2801
 9 | print((3.0).__mod__(4.0))  # PLC2801
   |       ^^^^^^^^^^^^^^^^^^
10 | print((3.0).__eq__(4.0))  # PLC2801
11 | print((3.0).__ne__(4.0))  # PLC2801
   |
help: Use `%` operator
   |
8  | print((3.0).__floordiv__(4.0))  # PLC2801
   - print((3.0).__mod__(4.0))  # PLC2801
9  + print(3.0 % 4.0)  # PLC2801
10 | print((3.0).__eq__(4.0))  # PLC2801
   |
note: This is an unsafe fix and may change runtime behavior

PLC2801 [*] Unnecessary dunder call to `__eq__`. Use `==` operator.
  --> unnecessary_dunder_call.py:10:7
   |
 8 | print((3.0).__floordiv__(4.0))  # PLC2801
 9 | print((3.0).__mod__(4.0))  # PLC2801
10 | print((3.0).__eq__(4.0))  # PLC2801
   |       ^^^^^^^^^^^^^^^^^
11 | print((3.0).__ne__(4.0))  # PLC2801
12 | print((3.0).__lt__(4.0))  # PLC2801
   |
help: Use `==` operator
   |
9  | print((3.0).__mod__(4.0))  # PLC2801
   - print((3.0).__eq__(4.0))  # PLC2801
10 + print(3.0 == 4.0)  # PLC2801
11 | print((3.0).__ne__(4.0))  # PLC2801
   |
note: This is an unsafe fix and may change runtime behavior

PLC2801 [*] Unnecessary dunder call to `__ne__`. Use `!=` operator.
  --> unnecessary_dunder_call.py:11:7
   |
 9 | print((3.0).__mod__(4.0))  # PLC2801
10 | print((3.0).__eq__(4.0))  # PLC2801
11 | print((3.0).__ne__(4.0))  # PLC2801
   |       ^^^^^^^^^^^^^^^^^
12 | print((3.0).__lt__(4.0))  # PLC2801
13 | print((3.0).__le__(4.0))  # PLC2801
   |
help: Use `!=` operator
   |
10 | print((3.0).__eq__(4.0))  # PLC2801
   - print((3.0).__ne__(4.0))  # PLC2801
11 + print(3.0 != 4.0)  # PLC2801
12 | print((3.0).__lt__(4.0))  # PLC2801
   |
note: This is an unsafe fix and may change runtime behavior

PLC2801 [*] Unnecessary dunder call to `__lt__`. Use `<` operator.
  --> unnecessary_dunder_call.py:12:7
   |
10 | print((3.0).__eq__(4.0))  # PLC2801
11 | print((3.0).__ne__(4.0))  # PLC2801
12 | print((3.0).__lt__(4.0))  # PLC2801
   |       ^^^^^^^^^^^^^^^^^
13 | print((3.0).__le__(4.0))  # PLC2801
14 | print((3.0).__gt__(4.0))  # PLC2801
   |
help: Use `<` operator
   |
11 | print((3.0).__ne__(4.0))  # PLC2801
   - print((3.0).__lt__(4.0))  # PLC2801
12 + print(3.0 < 4.0)  # PLC2801
13 | print((3.0).__le__(4.0))  # PLC2801
   |
note: This is an unsafe fix and may change runtime behavior

PLC2801 [*] Unnecessary dunder call to `__le__`. Use `<=` operator.
  --> unnecessary_dunder_call.py:13:7
   |
11 | print((3.0).__ne__(4.0))  # PLC2801
12 | print((3.0).__lt__(4.0))  # PLC2801
13 | print((3.0).__le__(4.0))  # PLC2801
   |       ^^^^^^^^^^^^^^^^^
14 | print((3.0).__gt__(4.0))  # PLC2801
15 | print((3.0).__ge__(4.0))  # PLC2801
   |
help: Use `<=` operator
   |
12 | print((3.0).__lt__(4.0))  # PLC2801
   - print((3.0).__le__(4.0))  # PLC2801
13 + print(3.0 <= 4.0)  # PLC2801
14 | print((3.0).__gt__(4.0))  # PLC2801
   |
note: This is an unsafe fix and may change runtime behavior

PLC2801 [*] Unnecessary dunder call to `__gt__`. Use `>` operator.
  --> unnecessary_dunder_call.py:14:7
   |
12 | print((3.0).__lt__(4.0))  # PLC2801
13 | print((3.0).__le__(4.0))  # PLC2801
14 | print((3.0).__gt__(4.0))  # PLC2801
   |       ^^^^^^^^^^^^^^^^^
15 | print((3.0).__ge__(4.0))  # PLC2801
16 | print((3.0).__str__())  # PLC2801
   |
help: Use `>` operator
   |
13 | print((3.0).__le__(4.0))  # PLC2801
   - print((3.0).__gt__(4.0))  # PLC2801
14 + print(3.0 > 4.0)  # PLC2801
15 | print((3.0).__ge__(4.0))  # PLC2801
   |
note: This is an unsafe fix and may change runtime behavior

PLC2801 [*] Unnecessary dunder call to `__ge__`. Use `>=` operator.
  --> unnecessary_dunder_call.py:15:7
   |
13 | print((3.0).__le__(4.0))  # PLC2801
14 | print((3.0).__gt__(4.0))  # PLC2801
15 | print((3.0).__ge__(4.0))  # PLC2801
   |       ^^^^^^^^^^^^^^^^^
16 | print((3.0).__str__())  # PLC2801
17 | print((3.0).__repr__())  # PLC2801
   |
help: Use `>=` operator
   |
14 | print((3.0).__gt__(4.0))  # PLC2801
   - print((3.0).__ge__(4.0))  # PLC2801
15 + print(3.0 >= 4.0)  # PLC2801
16 | print((3.0).__str__())  # PLC2801
   |
note: This is an unsafe fix and may change runtime behavior

PLC2801 [*] Unnecessary dunder call to `__str__`. Use `str()` builtin.
  --> unnecessary_dunder_call.py:16:7
   |
14 | print((3.0).__gt__(4.0))  # PLC2801
15 | print((3.0).__ge__(4.0))  # PLC2801
16 | print((3.0).__str__())  # PLC2801
   |       ^^^^^^^^^^^^^^^
17 | print((3.0).__repr__())  # PLC2801
18 | print([1, 2, 3].__len__())  # PLC2801
   |
help: Use `str()` builtin
   |
15 | print((3.0).__ge__(4.0))  # PLC2801
   - print((3.0).__str__())  # PLC2801
16 + print(str(3.0))  # PLC2801
17 | print((3.0).__repr__())  # PLC2801
   |
note: This is an unsafe fix and may change runtime behavior

PLC2801 [*] Unnecessary dunder call to `__repr__`. Use `repr()` builtin.
  --> unnecessary_dunder_call.py:17:7
   |
15 | print((3.0).__ge__(4.0))  # PLC2801
16 | print((3.0).__str__())  # PLC2801
17 | print((3.0).__repr__())  # PLC2801
   |       ^^^^^^^^^^^^^^^^
18 | print([1, 2, 3].__len__())  # PLC2801
19 | print((1).__neg__())  # PLC2801
   |
help: Use `repr()` builtin
   |
16 | print((3.0).__str__())  # PLC2801
   - print((3.0).__repr__())  # PLC2801
17 + print(repr(3.0))  # PLC2801
18 | print([1, 2, 3].__len__())  # PLC2801
   |
note: This is an unsafe fix and may change runtime behavior

PLC2801 [*] Unnecessary dunder call to `__len__`. Use `len()` builtin.
  --> unnecessary_dunder_call.py:18:7
   |
16 | print((3.0).__str__())  # PLC2801
17 | print((3.0).__repr__())  # PLC2801
18 | print([1, 2, 3].__len__())  # PLC2801
   |       ^^^^^^^^^^^^^^^^^^^
19 | print((1).__neg__())  # PLC2801
20 | print(-a.__sub__(1))  # PLC2801
   |
help: Use `len()` builtin
   |
17 | print((3.0).__repr__())  # PLC2801
   - print([1, 2, 3].__len__())  # PLC2801
18 + print(len([1, 2, 3]))  # PLC2801
19 | print((1).__neg__())  # PLC2801
   |
note: This is an unsafe fix and may change runtime behavior

PLC2801 Unnecessary dunder call to `__neg__`. Multiply by -1 instead.
  --> unnecessary_dunder_call.py:19:7
   |
17 | print((3.0).__repr__())  # PLC2801
18 | print([1, 2, 3].__len__())  # PLC2801
19 | print((1).__neg__())  # PLC2801
   |       ^^^^^^^^^^^^^
20 | print(-a.__sub__(1))  # PLC2801
21 | print(-(a).__sub__(1))  # PLC2801
   |
help: Multiply by -1 instead

PLC2801 [*] Unnecessary dunder call to `__sub__`. Use `-` operator.
  --> unnecessary_dunder_call.py:20:8
   |
18 | print([1, 2, 3].__len__())  # PLC2801
19 | print((1).__neg__())  # PLC2801
20 | print(-a.__sub__(1))  # PLC2801
   |        ^^^^^^^^^^^^
21 | print(-(a).__sub__(1))  # PLC2801
22 | print(-(-a.__sub__(1)))  # PLC2801
   |
help: Use `-` operator
   |
19 | print((1).__neg__())  # PLC2801
   - print(-a.__sub__(1))  # PLC2801
20 + print(-(a - 1))  # PLC2801
21 | print(-(a).__sub__(1))  # PLC2801
   |
note: This is an unsafe fix and may change runtime behavior

PLC2801 [*] Unnecessary dunder call to `__sub__`. Use `-` operator.
  --> unnecessary_dunder_call.py:21:8
   |
19 | print((1).__neg__())  # PLC2801
20 | print(-a.__sub__(1))  # PLC2801
21 | print(-(a).__sub__(1))  # PLC2801
   |        ^^^^^^^^^^^^^^
22 | print(-(-a.__sub__(1)))  # PLC2801
23 | print((5 - a).__sub__(1))  # PLC2801
   |
help: Use `-` operator
   |
20 | print(-a.__sub__(1))  # PLC2801
   - print(-(a).__sub__(1))  # PLC2801
21 + print(-(a - 1))  # PLC2801
22 | print(-(-a.__sub__(1)))  # PLC2801
   |
note: This is an unsafe fix and may change runtime behavior

PLC2801 [*] Unnecessary dunder call to `__sub__`. Use `-` operator.
  --> unnecessary_dunder_call.py:22:10
   |
20 | print(-a.__sub__(1))  # PLC2801
21 | print(-(a).__sub__(1))  # PLC2801
22 | print(-(-a.__sub__(1)))  # PLC2801
   |          ^^^^^^^^^^^^
23 | print((5 - a).__sub__(1))  # PLC2801
24 | print(-(5 - a).__sub__(1))  # PLC2801
   |
help: Use `-` operator
   |
21 | print(-(a).__sub__(1))  # PLC2801
   - print(-(-a.__sub__(1)))  # PLC2801
22 + print(-(-(a - 1)))  # PLC2801
23 | print((5 - a).__sub__(1))  # PLC2801
   |
note: This is an unsafe fix and may change runtime behavior

PLC2801 [*] Unnecessary dunder call to `__sub__`. Use `-` operator.
  --> unnecessary_dunder_call.py:23:7
   |
21 | print(-(a).__sub__(1))  # PLC2801
22 | print(-(-a.__sub__(1)))  # PLC2801
23 | print((5 - a).__sub__(1))  # PLC2801
   |       ^^^^^^^^^^^^^^^^^^
24 | print(-(5 - a).__sub__(1))  # PLC2801
25 | print(-(-5 - a).__sub__(1))  # PLC2801
   |
help: Use `-` operator
   |
22 | print(-(-a.__sub__(1)))  # PLC2801
   - print((5 - a).__sub__(1))  # PLC2801
23 + print(5 - a - 1)  # PLC2801
24 | print(-(5 - a).__sub__(1))  # PLC2801
   |
note: This is an unsafe fix and may change runtime behavior

PLC2801 [*] Unnecessary dunder call to `__sub__`. Use `-` operator.
  --> unnecessary_dunder_call.py:24:8
   |
22 | print(-(-a.__sub__(1)))  # PLC2801
23 | print((5 - a).__sub__(1))  # PLC2801
24 | print(-(5 - a).__sub__(1))  # PLC2801
   |        ^^^^^^^^^^^^^^^^^^
25 | print(-(-5 - a).__sub__(1))  # PLC2801
26 | print(+-+-+-a.__sub__(1))  # PLC2801
   |
help: Use `-` operator
   |
23 | print((5 - a).__sub__(1))  # PLC2801
   - print(-(5 - a).__sub__(1))  # PLC2801
24 + print(-(5 - a - 1))  # PLC2801
25 | print(-(-5 - a).__sub__(1))  # PLC2801
   |
note: This is an unsafe fix and may change runtime behavior

PLC2801 [*] Unnecessary dunder call to `__sub__`. Use `-` operator.
  --> unnecessary_dunder_call.py:25:8
   |
23 | print((5 - a).__sub__(1))  # PLC2801
24 | print(-(5 - a).__sub__(1))  # PLC2801
25 | print(-(-5 - a).__sub__(1))  # PLC2801
   |        ^^^^^^^^^^^^^^^^^^^
26 | print(+-+-+-a.__sub__(1))  # PLC2801
27 | print(a.__rsub__(2 - 1))  # PLC2801
   |
help: Use `-` operator
   |
24 | print(-(5 - a).__sub__(1))  # PLC2801
   - print(-(-5 - a).__sub__(1))  # PLC2801
25 + print(-(-5 - a - 1))  # PLC2801
26 | print(+-+-+-a.__sub__(1))  # PLC2801
   |
note: This is an unsafe fix and may change runtime behavior

PLC2801 [*] Unnecessary dunder call to `__sub__`. Use `-` operator.
  --> unnecessary_dunder_call.py:26:13
   |
24 | print(-(5 - a).__sub__(1))  # PLC2801
25 | print(-(-5 - a).__sub__(1))  # PLC2801
26 | print(+-+-+-a.__sub__(1))  # PLC2801
   |             ^^^^^^^^^^^^
27 | print(a.__rsub__(2 - 1))  # PLC2801
28 | print(a.__sub__(((((1))))))  # PLC2801
   |
help: Use `-` operator
   |
25 | print(-(-5 - a).__sub__(1))  # PLC2801
   - print(+-+-+-a.__sub__(1))  # PLC2801
26 + print(+-+-+-(a - 1))  # PLC2801
27 | print(a.__rsub__(2 - 1))  # PLC2801
   |
note: This is an unsafe fix and may change runtime behavior

PLC2801 [*] Unnecessary dunder call to `__rsub__`. Use `-` operator.
  --> unnecessary_dunder_call.py:27:7
   |
25 | print(-(-5 - a).__sub__(1))  # PLC2801
26 | print(+-+-+-a.__sub__(1))  # PLC2801
27 | print(a.__rsub__(2 - 1))  # PLC2801
   |       ^^^^^^^^^^^^^^^^^
28 | print(a.__sub__(((((1))))))  # PLC2801
29 | print(a.__sub__(((((2 - 1))))))  # PLC2801
   |
help: Use `-` operator
   |
26 | print(+-+-+-a.__sub__(1))  # PLC2801
   - print(a.__rsub__(2 - 1))  # PLC2801
27 + print((2 - 1) - a)  # PLC2801
28 | print(a.__sub__(((((1))))))  # PLC2801
   |
note: This is an unsafe fix and may change runtime behavior

PLC2801 [*] Unnecessary dunder call to `__sub__`. Use `-` operator.
  --> unnecessary_dunder_call.py:28:7
   |
26 | print(+-+-+-a.__sub__(1))  # PLC2801
27 | print(a.__rsub__(2 - 1))  # PLC2801
28 | print(a.__sub__(((((1))))))  # PLC2801
   |       ^^^^^^^^^^^^^^^^^^^^
29 | print(a.__sub__(((((2 - 1))))))  # PLC2801
30 | print(a.__sub__(
   |
help: Use `-` operator
   |
27 | print(a.__rsub__(2 - 1))  # PLC2801
   - print(a.__sub__(((((1))))))  # PLC2801
28 + print(a - 1)  # PLC2801
29 | print(a.__sub__(((((2 - 1))))))  # PLC2801
   |
note: This is an unsafe fix and may change runtime behavior

PLC2801 [*] Unnecessary dunder call to `__sub__`. Use `-` operator.
  --> unnecessary_dunder_call.py:29:7
   |
27 | print(a.__rsub__(2 - 1))  # PLC2801
28 | print(a.__sub__(((((1))))))  # PLC2801
29 | print(a.__sub__(((((2 - 1))))))  # PLC2801
   |       ^^^^^^^^^^^^^^^^^^^^^^^^
30 | print(a.__sub__(
31 |     3
   |
help: Use `-` operator
   |
28 | print(a.__sub__(((((1))))))  # PLC2801
   - print(a.__sub__(((((2 - 1))))))  # PLC2801
29 + print(a - (2 - 1))  # PLC2801
30 | print(a.__sub__(
   |
note: This is an unsafe fix and may change runtime behavior

PLC2801 [*] Unnecessary dunder call to `__sub__`. Use `-` operator.
  --> unnecessary_dunder_call.py:30:7
   |
28 |   print(a.__sub__(((((1))))))  # PLC2801
29 |   print(a.__sub__(((((2 - 1))))))  # PLC2801
30 |   print(a.__sub__(
   |  _______^
31 | |     3
32 | |     +
33 | |     4
34 | | ))
   | |_^
35 |   print(a.__rsub__(
36 |       3
   |
help: Use `-` operator
   |
29 | print(a.__sub__(((((2 - 1))))))  # PLC2801
   - print(a.__sub__(
   -     3
30 + print(a - (3
31 |     +
   -     4
   - ))
32 +     4))
33 | print(a.__rsub__(
   |
note: This is an unsafe fix and may change runtime behavior

PLC2801 [*] Unnecessary dunder call to `__rsub__`. Use `-` operator.
  --> unnecessary_dunder_call.py:35:7
   |
33 |       4
34 |   ))
35 |   print(a.__rsub__(
   |  _______^
36 | |     3
37 | |     +
38 | |     4
39 | | ))
   | |_^
40 |   print(2 * a.__add__(3))  # PLC2801
41 |   x = 2 * a.__add__(3)  # PLC2801
   |
help: Use `-` operator
   |
34 | ))
   - print(a.__rsub__(
   -     3
35 + print((3
36 |     +
   -     4
   - ))
37 +     4) - a)
38 | print(2 * a.__add__(3))  # PLC2801
   |
note: This is an unsafe fix and may change runtime behavior

PLC2801 [*] Unnecessary dunder call to `__add__`. Use `+` operator.
  --> unnecessary_dunder_call.py:40:11
   |
38 |     4
39 | ))
40 | print(2 * a.__add__(3))  # PLC2801
   |           ^^^^^^^^^^^^
41 | x = 2 * a.__add__(3)  # PLC2801
42 | x = 2 * -a.__add__(3)  # PLC2801
   |
help: Use `+` operator
   |
39 | ))
   - print(2 * a.__add__(3))  # PLC2801
40 + print(2 * (a + 3))  # PLC2801
41 | x = 2 * a.__add__(3)  # PLC2801
   |
note: This is an unsafe fix and may change runtime behavior

PLC2801 [*] Unnecessary dunder call to `__add__`. Use `+` operator.
  --> unnecessary_dunder_call.py:41:9
   |
39 | ))
40 | print(2 * a.__add__(3))  # PLC2801
41 | x = 2 * a.__add__(3)  # PLC2801
   |         ^^^^^^^^^^^^
42 | x = 2 * -a.__add__(3)  # PLC2801
43 | x = a.__add__(3)  # PLC2801
   |
help: Use `+` operator
   |
40 | print(2 * a.__add__(3))  # PLC2801
   - x = 2 * a.__add__(3)  # PLC2801
41 + x = 2 * (a + 3)  # PLC2801
42 | x = 2 * -a.__add__(3)  # PLC2801
   |
note: This is an unsafe fix and may change runtime behavior

PLC2801 [*] Unnecessary dunder call to `__add__`. Use `+` operator.
  --> unnecessary_dunder_call.py:42:10
   |
40 | print(2 * a.__add__(3))  # PLC2801
41 | x = 2 * a.__add__(3)  # PLC2801
42 | x = 2 * -a.__add__(3)  # PLC2801
   |          ^^^^^^^^^^^^
43 | x = a.__add__(3)  # PLC2801
44 | x = -a.__add__(3)  # PLC2801
   |
help: Use `+` operator
   |
41 | x = 2 * a.__add__(3)  # PLC2801
   - x = 2 * -a.__add__(3)  # PLC2801
42 + x = 2 * -(a + 3)  # PLC2801
43 | x = a.__add__(3)  # PLC2801
   |
note: This is an unsafe fix and may change runtime behavior

PLC2801 [*] Unnecessary dunder call to `__add__`. Use `+` operator.
  --> unnecessary_dunder_call.py:43:5
   |
41 | x = 2 * a.__add__(3)  # PLC2801
42 | x = 2 * -a.__add__(3)  # PLC2801
43 | x = a.__add__(3)  # PLC2801
   |     ^^^^^^^^^^^^
44 | x = -a.__add__(3)  # PLC2801
45 | x = (-a).__add__(3)  # PLC2801
   |
help: Use `+` operator
   |
42 | x = 2 * -a.__add__(3)  # PLC2801
   - x = a.__add__(3)  # PLC2801
43 + x = a + 3  # PLC2801
44 | x = -a.__add__(3)  # PLC2801
   |
note: This is an unsafe fix and may change runtime behavior

PLC2801 [*] Unnecessary dunder call to `__add__`. Use `+` operator.
  --> unnecessary_dunder_call.py:44:6
   |
42 | x = 2 * -a.__add__(3)  # PLC2801
43 | x = a.__add__(3)  # PLC2801
44 | x = -a.__add__(3)  # PLC2801
   |      ^^^^^^^^^^^^
45 | x = (-a).__add__(3)  # PLC2801
46 | x = -(-a).__add__(3)  # PLC2801
   |
help: Use `+` operator
   |
43 | x = a.__add__(3)  # PLC2801
   - x = -a.__add__(3)  # PLC2801
44 + x = -(a + 3)  # PLC2801
45 | x = (-a).__add__(3)  # PLC2801
   |
note: This is an unsafe fix and may change runtime behavior

PLC2801 [*] Unnecessary dunder call to `__add__`. Use `+` operator.
  --> unnecessary_dunder_call.py:45:5
   |
43 | x = a.__add__(3)  # PLC2801
44 | x = -a.__add__(3)  # PLC2801
45 | x = (-a).__add__(3)  # PLC2801
   |     ^^^^^^^^^^^^^^^
46 | x = -(-a).__add__(3)  # PLC2801
   |
help: Use `+` operator
   |
44 | x = -a.__add__(3)  # PLC2801
   - x = (-a).__add__(3)  # PLC2801
45 + x = -a + 3  # PLC2801
46 | x = -(-a).__add__(3)  # PLC2801
   |
note: This is an unsafe fix and may change runtime behavior

PLC2801 [*] Unnecessary dunder call to `__add__`. Use `+` operator.
  --> unnecessary_dunder_call.py:46:6
   |
44 | x = -a.__add__(3)  # PLC2801
45 | x = (-a).__add__(3)  # PLC2801
46 | x = -(-a).__add__(3)  # PLC2801
   |      ^^^^^^^^^^^^^^^
47 |
48 | # Calls
   |
help: Use `+` operator
   |
45 | x = (-a).__add__(3)  # PLC2801
   - x = -(-a).__add__(3)  # PLC2801
46 + x = -(-a + 3)  # PLC2801
47 |
   |
note: This is an unsafe fix and may change runtime behavior

PLC2801 Unnecessary dunder call to `__call__`
  --> unnecessary_dunder_call.py:49:7
   |
48 | # Calls
49 | print(a.__call__())  # PLC2801 (no fix, intentional)
   |       ^^^^^^^^^^^^
50 |
51 | class Foo:
   |

PLC2801 [*] Unnecessary dunder call to `__add__`. Use `+` operator.
  --> unnecessary_dunder_call.py:63:1
   |
62 | foo = Foo(1)
63 | foo.__add__(2).get_v()  # PLC2801
   | ^^^^^^^^^^^^^^
   |
help: Use `+` operator
   |
62 | foo = Foo(1)
   - foo.__add__(2).get_v()  # PLC2801
63 + (foo + 2).get_v()  # PLC2801
64 |
   |
note: This is an unsafe fix and may change runtime behavior

PLC2801 [*] Unnecessary dunder call to `__add__`. Use `+` operator.
  --> unnecessary_dunder_call.py:67:16
   |
66 | # Lambda expressions
67 | blah = lambda: a.__add__(1)  # PLC2801
   |                ^^^^^^^^^^^^
68 |
69 | # If expressions
   |
help: Use `+` operator
   |
66 | # Lambda expressions
   - blah = lambda: a.__add__(1)  # PLC2801
67 + blah = lambda: a + 1  # PLC2801
68 |
   |
note: This is an unsafe fix and may change runtime behavior

PLC2801 [*] Unnecessary dunder call to `__add__`. Use `+` operator.
  --> unnecessary_dunder_call.py:70:7
   |
69 | # If expressions
70 | print(a.__add__(1) if a > 0 else a.__sub__(1))  # PLC2801
   |       ^^^^^^^^^^^^
71 |
72 | # Dict/Set/List/Tuple
   |
help: Use `+` operator
   |
69 | # If expressions
   - print(a.__add__(1) if a > 0 else a.__sub__(1))  # PLC2801
70 + print(a + 1 if a > 0 else a.__sub__(1))  # PLC2801
71 |
   |
note: This is an unsafe fix and may change runtime behavior

PLC2801 [*] Unnecessary dunder call to `__sub__`. Use `-` operator.
  --> unnecessary_dunder_call.py:70:34
   |
69 | # If expressions
70 | print(a.__add__(1) if a > 0 else a.__sub__(1))  # PLC2801
   |                                  ^^^^^^^^^^^^
71 |
72 | # Dict/Set/List/Tuple
   |
help: Use `-` operator
   |
69 | # If expressions
   - print(a.__add__(1) if a > 0 else a.__sub__(1))  # PLC2801
70 + print(a.__add__(1) if a > 0 else a - 1)  # PLC2801
71 |
   |
note: This is an unsafe fix and may change runtime behavior

PLC2801 [*] Unnecessary dunder call to `__add__`. Use `+` operator.
  --> unnecessary_dunder_call.py:73:13
   |
72 | # Dict/Set/List/Tuple
73 | print({"a": a.__add__(1)})  # PLC2801
   |             ^^^^^^^^^^^^
74 | print({a.__add__(1)})  # PLC2801
75 | print([a.__add__(1)])  # PLC2801
   |
help: Use `+` operator
   |
72 | # Dict/Set/List/Tuple
   - print({"a": a.__add__(1)})  # PLC2801
73 + print({"a": (a + 1)})  # PLC2801
74 | print({a.__add__(1)})  # PLC2801
   |
note: This is an unsafe fix and may change runtime behavior

PLC2801 [*] Unnecessary dunder call to `__add__`. Use `+` operator.
  --> unnecessary_dunder_call.py:74:8
   |
72 | # Dict/Set/List/Tuple
73 | print({"a": a.__add__(1)})  # PLC2801
74 | print({a.__add__(1)})  # PLC2801
   |        ^^^^^^^^^^^^
75 | print([a.__add__(1)])  # PLC2801
76 | print((a.__add__(1),))  # PLC2801
   |
help: Use `+` operator
   |
73 | print({"a": a.__add__(1)})  # PLC2801
   - print({a.__add__(1)})  # PLC2801
74 + print({(a + 1)})  # PLC2801
75 | print([a.__add__(1)])  # PLC2801
   |
note: This is an unsafe fix and may change runtime behavior

PLC2801 [*] Unnecessary dunder call to `__add__`. Use `+` operator.
  --> unnecessary_dunder_call.py:75:8
   |
73 | print({"a": a.__add__(1)})  # PLC2801
74 | print({a.__add__(1)})  # PLC2801
75 | print([a.__add__(1)])  # PLC2801
   |        ^^^^^^^^^^^^
76 | print((a.__add__(1),))  # PLC2801
   |
help: Use `+` operator
   |
74 | print({a.__add__(1)})  # PLC2801
   - print([a.__add__(1)])  # PLC2801
75 + print([(a + 1)])  # PLC2801
76 | print((a.__add__(1),))  # PLC2801
   |
note: This is an unsafe fix and may change runtime behavior

PLC2801 [*] Unnecessary dunder call to `__add__`. Use `+` operator.
  --> unnecessary_dunder_call.py:76:8
   |
74 | print({a.__add__(1)})  # PLC2801
75 | print([a.__add__(1)])  # PLC2801
76 | print((a.__add__(1),))  # PLC2801
   |        ^^^^^^^^^^^^
77 |
78 | # Comprehension variants
   |
help: Use `+` operator
   |
75 | print([a.__add__(1)])  # PLC2801
   - print((a.__add__(1),))  # PLC2801
76 + print(((a + 1),))  # PLC2801
77 |
   |
note: This is an unsafe fix and may change runtime behavior

PLC2801 [*] Unnecessary dunder call to `__add__`. Use `+` operator.
  --> unnecessary_dunder_call.py:79:11
   |
78 | # Comprehension variants
79 | print({i: i.__add__(1) for i in range(5)})  # PLC2801
   |           ^^^^^^^^^^^^
80 | print({i.__add__(1) for i in range(5)})  # PLC2801
81 | print([i.__add__(1) for i in range(5)])  # PLC2801
   |
help: Use `+` operator
   |
78 | # Comprehension variants
   - print({i: i.__add__(1) for i in range(5)})  # PLC2801
79 + print({i: (i + 1) for i in range(5)})  # PLC2801
80 | print({i.__add__(1) for i in range(5)})  # PLC2801
   |
note: This is an unsafe fix and may change runtime behavior

PLC2801 [*] Unnecessary dunder call to `__add__`. Use `+` operator.
  --> unnecessary_dunder_call.py:80:8
   |
78 | # Comprehension variants
79 | print({i: i.__add__(1) for i in range(5)})  # PLC2801
80 | print({i.__add__(1) for i in range(5)})  # PLC2801
   |        ^^^^^^^^^^^^
81 | print([i.__add__(1) for i in range(5)])  # PLC2801
82 | print((i.__add__(1) for i in range(5)))  # PLC2801
   |
help: Use `+` operator
   |
79 | print({i: i.__add__(1) for i in range(5)})  # PLC2801
   - print({i.__add__(1) for i in range(5)})  # PLC2801
80 + print({(i + 1) for i in range(5)})  # PLC2801
81 | print([i.__add__(1) for i in range(5)])  # PLC2801
   |
note: This is an unsafe fix and may change runtime behavior

PLC2801 [*] Unnecessary dunder call to `__add__`. Use `+` operator.
  --> unnecessary_dunder_call.py:81:8
   |
79 | print({i: i.__add__(1) for i in range(5)})  # PLC2801
80 | print({i.__add__(1) for i in range(5)})  # PLC2801
81 | print([i.__add__(1) for i in range(5)])  # PLC2801
   |        ^^^^^^^^^^^^
82 | print((i.__add__(1) for i in range(5)))  # PLC2801
   |
help: Use `+` operator
   |
80 | print({i.__add__(1) for i in range(5)})  # PLC2801
   - print([i.__add__(1) for i in range(5)])  # PLC2801
81 + print([(i + 1) for i in range(5)])  # PLC2801
82 | print((i.__add__(1) for i in range(5)))  # PLC2801
   |
note: This is an unsafe fix and may change runtime behavior

PLC2801 [*] Unnecessary dunder call to `__add__`. Use `+` operator.
  --> unnecessary_dunder_call.py:82:8
   |
80 | print({i.__add__(1) for i in range(5)})  # PLC2801
81 | print([i.__add__(1) for i in range(5)])  # PLC2801
82 | print((i.__add__(1) for i in range(5)))  # PLC2801
   |        ^^^^^^^^^^^^
83 |
84 | # Generators
   |
help: Use `+` operator
   |
81 | print([i.__add__(1) for i in range(5)])  # PLC2801
   - print((i.__add__(1) for i in range(5)))  # PLC2801
82 + print(((i + 1) for i in range(5)))  # PLC2801
83 |
   |
note: This is an unsafe fix and may change runtime behavior

PLC2801 [*] Unnecessary dunder call to `__add__`. Use `+` operator.
  --> unnecessary_dunder_call.py:85:8
   |
84 | # Generators
85 | gen = (i.__add__(1) for i in range(5))  # PLC2801
   |        ^^^^^^^^^^^^
86 | print(next(gen))
   |
help: Use `+` operator
   |
84 | # Generators
   - gen = (i.__add__(1) for i in range(5))  # PLC2801
85 + gen = ((i + 1) for i in range(5))  # PLC2801
86 | print(next(gen))
   |
note: This is an unsafe fix and may change runtime behavior

PLC2801 [*] Unnecessary dunder call to `__add__`. Use `+` operator.
  --> unnecessary_dunder_call.py:89:13
   |
88 | # Subscripts
89 | print({"a": a.__add__(1)}["a"])  # PLC2801
   |             ^^^^^^^^^^^^
90 | # https://github.com/astral-sh/ruff/issues/15745
91 | print("x".__add__("y")[0])  # PLC2801
   |
help: Use `+` operator
   |
88 | # Subscripts
   - print({"a": a.__add__(1)}["a"])  # PLC2801
89 + print({"a": (a + 1)}["a"])  # PLC2801
90 | # https://github.com/astral-sh/ruff/issues/15745
   |
note: This is an unsafe fix and may change runtime behavior

PLC2801 [*] Unnecessary dunder call to `__add__`. Use `+` operator.
  --> unnecessary_dunder_call.py:91:7
   |
89 | print({"a": a.__add__(1)}["a"])  # PLC2801
90 | # https://github.com/astral-sh/ruff/issues/15745
91 | print("x".__add__("y")[0])  # PLC2801
   |       ^^^^^^^^^^^^^^^^
92 |
93 | # Starred
   |
help: Use `+` operator
   |
90 | # https://github.com/astral-sh/ruff/issues/15745
   - print("x".__add__("y")[0])  # PLC2801
91 + print(("x" + "y")[0])  # PLC2801
92 |
   |
note: This is an unsafe fix and may change runtime behavior

PLC2801 [*] Unnecessary dunder call to `__add__`. Use `+` operator.
  --> unnecessary_dunder_call.py:94:9
   |
93 | # Starred
94 | print(*[a.__add__(1)])  # PLC2801
   |         ^^^^^^^^^^^^
95 |
96 | list1 = [1, 2, 3]
   |
help: Use `+` operator
   |
93 | # Starred
   - print(*[a.__add__(1)])  # PLC2801
94 + print(*[(a + 1)])  # PLC2801
95 |
   |
note: This is an unsafe fix and may change runtime behavior

PLC2801 [*] Unnecessary dunder call to `__add__`. Use `+` operator.
   --> unnecessary_dunder_call.py:98:9
    |
 96 | list1 = [1, 2, 3]
 97 | list2 = [4, 5, 6]
 98 | print([*list1.__add__(list2)])  # PLC2801
    |         ^^^^^^^^^^^^^^^^^^^^
 99 |
100 | # Slices
    |
help: Use `+` operator
   |
97 | list2 = [4, 5, 6]
   - print([*list1.__add__(list2)])  # PLC2801
98 + print([*list1 + list2])  # PLC2801
99 |
   |
note: This is an unsafe fix and may change runtime behavior

PLC2801 [*] Unnecessary dunder call to `__add__`. Use `+` operator.
   --> unnecessary_dunder_call.py:101:8
    |
100 | # Slices
101 | print([a.__add__(1), a.__sub__(1)][0:1])  # PLC2801
    |        ^^^^^^^^^^^^
102 |
103 | # Attribute access
    |
help: Use `+` operator
    |
100 | # Slices
    - print([a.__add__(1), a.__sub__(1)][0:1])  # PLC2801
101 + print([(a + 1), a.__sub__(1)][0:1])  # PLC2801
102 |
    |
note: This is an unsafe fix and may change runtime behavior

PLC2801 [*] Unnecessary dunder call to `__sub__`. Use `-` operator.
   --> unnecessary_dunder_call.py:101:22
    |
100 | # Slices
101 | print([a.__add__(1), a.__sub__(1)][0:1])  # PLC2801
    |                      ^^^^^^^^^^^^
102 |
103 | # Attribute access
    |
help: Use `-` operator
    |
100 | # Slices
    - print([a.__add__(1), a.__sub__(1)][0:1])  # PLC2801
101 + print([a.__add__(1), (a - 1)][0:1])  # PLC2801
102 |
    |
note: This is an unsafe fix and may change runtime behavior

PLC2801 [*] Unnecessary dunder call to `__add__`. Use `+` operator.
   --> unnecessary_dunder_call.py:105:7
    |
103 | # Attribute access
104 | # https://github.com/astral-sh/ruff/issues/15745
105 | print(1j.__add__(1.0).real) # PLC2801
    |       ^^^^^^^^^^^^^^^
106 |
107 | class Thing:
    |
help: Use `+` operator
    |
104 | # https://github.com/astral-sh/ruff/issues/15745
    - print(1j.__add__(1.0).real) # PLC2801
105 + print((1j + 1.0).real) # PLC2801
106 |
    |
note: This is an unsafe fix and may change runtime behavior

PLC2801 Unnecessary dunder call to `__getattribute__`. Access attribute directly or use getattr built-in function.
   --> unnecessary_dunder_call.py:116:16
    |
115 |     def do_thing(self, item):
116 |         return object.__getattribute__(self, item)  # PLC2801
    |                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
117 |
118 |     def use_descriptor(self, item):
    |
help: Access attribute directly or use getattr built-in function

PLC2801 [*] Unnecessary dunder call to `__contains__`. Use `in` operator.
   --> unnecessary_dunder_call.py:128:1
    |
126 | blah = dict[{"a": 1}.__delitem__("a")]  # OK
127 |
128 | "abc".__contains__("a")
    | ^^^^^^^^^^^^^^^^^^^^^^^
129 |
130 | # https://github.com/astral-sh/ruff/issues/14597
    |
help: Use `in` operator
    |
127 |
    - "abc".__contains__("a")
128 + "a" in "abc"
129 |
    |
note: This is an unsafe fix and may change runtime behavior

PLC2801 [*] Unnecessary dunder call to `__str__`. Use `str()` builtin.
   --> unnecessary_dunder_call.py:131:8
    |
130 | # https://github.com/astral-sh/ruff/issues/14597
131 | assert "abc".__str__() == "abc"
    |        ^^^^^^^^^^^^^^^
132 |
133 | # https://github.com/astral-sh/ruff/issues/18813
    |
help: Use `str()` builtin
    |
130 | # https://github.com/astral-sh/ruff/issues/14597
    - assert "abc".__str__() == "abc"
131 + assert str("abc") == "abc"
132 |
    |
note: This is an unsafe fix and may change runtime behavior

PLC2801 [*] Unnecessary dunder call to `__str__`. Use `str()` builtin.
   --> unnecessary_dunder_call.py:134:20
    |
133 | # https://github.com/astral-sh/ruff/issues/18813
134 | three = 1 if 1 else(3.0).__str__()
    |                    ^^^^^^^^^^^^^^^
135 |
136 | # https://github.com/astral-sh/ruff/issues/26221
    |
help: Use `str()` builtin
    |
133 | # https://github.com/astral-sh/ruff/issues/18813
    - three = 1 if 1 else(3.0).__str__()
134 + three = 1 if 1 else str(3.0)
135 |
    |
note: This is an unsafe fix and may change runtime behavior

PLC2801 Unnecessary dunder call to `__floor__`. Use `math.floor()` function.
   --> unnecessary_dunder_call.py:137:7
    |
136 | # https://github.com/astral-sh/ruff/issues/26221
137 | print((3.0).__floor__())  # PLC2801
    |       ^^^^^^^^^^^^^^^^^
138 | print((3.0).__ceil__())  # PLC2801
139 | print((3.0).__trunc__())  # PLC2801
    |
help: Use `math.floor()` function

PLC2801 Unnecessary dunder call to `__ceil__`. Use `math.ceil()` function.
   --> unnecessary_dunder_call.py:138:7
    |
136 | # https://github.com/astral-sh/ruff/issues/26221
137 | print((3.0).__floor__())  # PLC2801
138 | print((3.0).__ceil__())  # PLC2801
    |       ^^^^^^^^^^^^^^^^
139 | print((3.0).__trunc__())  # PLC2801
140 | Foo().__length_hint__()  # PLC2801
    |
help: Use `math.ceil()` function

PLC2801 Unnecessary dunder call to `__trunc__`. Use `math.trunc()` function.
   --> unnecessary_dunder_call.py:139:7
    |
137 | print((3.0).__floor__())  # PLC2801
138 | print((3.0).__ceil__())  # PLC2801
139 | print((3.0).__trunc__())  # PLC2801
    |       ^^^^^^^^^^^^^^^^^
140 | Foo().__length_hint__()  # PLC2801
141 | Foo().__matmul__(Foo())  # PLC2801
    |
help: Use `math.trunc()` function

PLC2801 Unnecessary dunder call to `__length_hint__`. Use `operator.length_hint()` function.
   --> unnecessary_dunder_call.py:140:1
    |
138 | print((3.0).__ceil__())  # PLC2801
139 | print((3.0).__trunc__())  # PLC2801
140 | Foo().__length_hint__()  # PLC2801
    | ^^^^^^^^^^^^^^^^^^^^^^^
141 | Foo().__matmul__(Foo())  # PLC2801
142 | foo.__rmatmul__(a)  # PLC2801
    |
help: Use `operator.length_hint()` function

PLC2801 [*] Unnecessary dunder call to `__matmul__`. Use `@` operator.
   --> unnecessary_dunder_call.py:141:1
    |
139 | print((3.0).__trunc__())  # PLC2801
140 | Foo().__length_hint__()  # PLC2801
141 | Foo().__matmul__(Foo())  # PLC2801
    | ^^^^^^^^^^^^^^^^^^^^^^^
142 | foo.__rmatmul__(a)  # PLC2801
143 | foo.__imatmul__(foo)  # PLC2801
    |
help: Use `@` operator
    |
140 | Foo().__length_hint__()  # PLC2801
    - Foo().__matmul__(Foo())  # PLC2801
141 + Foo() @ Foo()  # PLC2801
142 | foo.__rmatmul__(a)  # PLC2801
    |
note: This is an unsafe fix and may change runtime behavior

PLC2801 [*] Unnecessary dunder call to `__rmatmul__`. Use `@` operator.
   --> unnecessary_dunder_call.py:142:1
    |
140 | Foo().__length_hint__()  # PLC2801
141 | Foo().__matmul__(Foo())  # PLC2801
142 | foo.__rmatmul__(a)  # PLC2801
    | ^^^^^^^^^^^^^^^^^^
143 | foo.__imatmul__(foo)  # PLC2801
    |
help: Use `@` operator
    |
141 | Foo().__matmul__(Foo())  # PLC2801
    - foo.__rmatmul__(a)  # PLC2801
142 + a @ foo  # PLC2801
143 | foo.__imatmul__(foo)  # PLC2801
    |
note: This is an unsafe fix and may change runtime behavior

PLC2801 [*] Unnecessary dunder call to `__imatmul__`. Use `@=` operator.
   --> unnecessary_dunder_call.py:143:1
    |
141 | Foo().__matmul__(Foo())  # PLC2801
142 | foo.__rmatmul__(a)  # PLC2801
143 | foo.__imatmul__(foo)  # PLC2801
    | ^^^^^^^^^^^^^^^^^^^^
    |
help: Use `@=` operator
    |
142 | foo.__rmatmul__(a)  # PLC2801
    - foo.__imatmul__(foo)  # PLC2801
143 + foo @= foo  # PLC2801
    |
note: This is an unsafe fix and may change runtime behavior
