.. _unexpected-special-method-signature:

unexpected-special-method-signature / E0302
===========================================

**Message emitted:**

The special method %r expects %s param(s), %d %s given

**Description:**

*Emitted when a special method was defined with an invalid number of parameters. If it has too few or too many, it might not work at all.*

**Problematic code:**

.. literalinclude:: /data/messages/u/unexpected-special-method-signature/bad.py
   :language: python

**Correct code:**

.. literalinclude:: /data/messages/u/unexpected-special-method-signature/good.py
   :language: python



Created by the `classes <https://github.com/PyCQA/pylint/blob/main/pylint/checkers/classes/special_methods_checker.py>`__ checker.