.. _bad-super-call:

bad-super-call / E1003
======================

**Message emitted:**

Bad first argument %r given to super()

**Description:**

*Used when another argument than the current class is given as first argument of the super builtin.*

**Problematic code:**

.. literalinclude:: /data/messages/b/bad-super-call/bad.py
   :language: python

**Correct code:**

.. literalinclude:: /data/messages/b/bad-super-call/good.py
   :language: python

**Additional details:**

In Python 2.7, ``super()`` has to be called with its own class and ``self`` as arguments (``super(Cat, self)``), which can
lead to a mix up of parent and child class in the code.

In Python 3 the recommended way is to call ``super()`` without arguments (see also ``super-with-arguments``).

One exception is calling ``super()`` on a non-direct parent class. This can be used to get a method other than the default
method returned by the ``mro()``.

**Related links:**

- `Documentation for super() <https://docs.python.org/3/library/functions.html#super>`_

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