---
source: crates/ruff_linter/src/rules/pylint/mod.rs
---
PLE0302 The special method `__bool__` expects 1 parameter, 2 were given
 --> unexpected_special_method_signature.py:5:9
  |
3 |         ...
4 |
5 |     def __bool__(self, x):  # too many mandatory args
  |         ^^^^^^^^
6 |         ...
  |

PLE0302 The special method `__bool__` expects 0 parameters, 1 was given
  --> unexpected_special_method_signature.py:19:9
   |
18 |     @staticmethod
19 |     def __bool__(x):  # too many mandatory args
   |         ^^^^^^^^
20 |         ...
   |

PLE0302 The special method `__eq__` expects 2 parameters, 1 was given
  --> unexpected_special_method_signature.py:32:9
   |
30 |         ...
31 |
32 |     def __eq__(self):  # too few mandatory args
   |         ^^^^^^
33 |         ...
   |

PLE0302 The special method `__eq__` expects 2 parameters, 3 were given
  --> unexpected_special_method_signature.py:35:9
   |
33 |         ...
34 |
35 |     def __eq__(self, other, other_other):  # too many mandatory args
   |         ^^^^^^
36 |         ...
   |

PLE0302 The special method `__round__` expects between 1 and 2 parameters, 3 were given
  --> unexpected_special_method_signature.py:44:9
   |
42 |         ...
43 |
44 |     def __round__(self, x, y):  # disallow 2 args
   |         ^^^^^^^^^
45 |         ...
   |

PLE0302 The special method `__round__` expects between 1 and 2 parameters, 4 were given
  --> unexpected_special_method_signature.py:47:9
   |
45 |         ...
46 |
47 |     def __round__(self, x, y, z=2):  # disallow 3 args even when one is optional
   |         ^^^^^^^^^
48 |         ...
   |

PLE0302 The special method `__eq__` expects 2 parameters, 3 were given
  --> unexpected_special_method_signature.py:56:9
   |
54 |         ...
55 |
56 |     def __eq__(self, x, y, *args):  # too many args with *args
   |         ^^^^^^
57 |         ...
   |

PLE0302 The special method `__round__` expects between 1 and 2 parameters, 3 were given
  --> unexpected_special_method_signature.py:65:9
   |
63 |         ...
64 |
65 |     def __round__(self, x, y, *args):  # disallow 2 args
   |         ^^^^^^^^^
66 |         ...
   |

PLE0302 The special method `__next__` expects 1 parameter, 2 were given
  --> unexpected_special_method_signature.py:89:9
   |
87 |         ...
88 |
89 |     def __next__(self, x): # #16217 assert special method is linted, expects 1 parameter
   |         ^^^^^^^^
90 |         ...
   |

PLE0302 The special method `__buffer__` expects 2 parameters, 1 was given
  --> unexpected_special_method_signature.py:92:9
   |
90 |         ...
91 |
92 |     def __buffer__(self): # #16217 assert special method is linted, expects 2 parameters
   |         ^^^^^^^^^^
93 |         ...
   |

PLE0302 The special method `__class_getitem__` expects 2 parameters, 1 was given
  --> unexpected_special_method_signature.py:95:9
   |
93 |         ...
94 |
95 |     def __class_getitem__(self): # #16217 assert special method is linted, expects 2 parameters
   |         ^^^^^^^^^^^^^^^^^
96 |         ...
   |

PLE0302 The special method `__mro_entries__` expects 2 parameters, 1 was given
  --> unexpected_special_method_signature.py:98:9
   |
96 |         ...
97 |
98 |     def __mro_entries__(self): # #16217 assert special method is linted, expects 2 parameters
   |         ^^^^^^^^^^^^^^^
99 |         ...
   |

PLE0302 The special method `__release_buffer__` expects 2 parameters, 1 was given
   --> unexpected_special_method_signature.py:101:9
    |
 99 |         ...
100 |
101 |     def __release_buffer__(self): # #16217 assert special method is linted, expects 2 parameters
    |         ^^^^^^^^^^^^^^^^^^
102 |         ...
    |

PLE0302 The special method `__subclasshook__` expects 2 parameters, 1 was given
   --> unexpected_special_method_signature.py:104:9
    |
102 |         ...
103 |
104 |     def __subclasshook__(self): # #16217 assert special method is linted, expects 2 parameters
    |         ^^^^^^^^^^^^^^^^
105 |         ...
    |

PLE0302 The special method `__setattr__` expects 3 parameters, 2 were given
   --> unexpected_special_method_signature.py:107:9
    |
105 |         ...
106 |
107 |     def __setattr__(self, /, name): # #16217 assert positional-only special method is linted, expects 3 parameters
    |         ^^^^^^^^^^^
108 |         ...
    |

PLE0302 The special method `__setitem__` expects 3 parameters, 4 were given
   --> unexpected_special_method_signature.py:110:9
    |
108 |         ...
109 |
110 |     def __setitem__(self, key, /, value, extra_value): # #16217 assert positional-only special method is linted, expects 3 parameters
    |         ^^^^^^^^^^^
111 |         ...
    |
