.. _invalid-class-object:

invalid-class-object / E0243
============================

**Message emitted:**

Invalid assignment to '__class__'. Should be a class definition but got a '%s'

**Description:**

*Used when an invalid object is assigned to a __class__ property. Only a class is permitted.*

**Problematic code:**

.. literalinclude:: /data/messages/i/invalid-class-object/bad.py
   :language: python

**Correct code:**

.. literalinclude:: /data/messages/i/invalid-class-object/good.py
   :language: python



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