.. _redefined-variable-type:

redefined-variable-type / R0204
===============================

**Message emitted:**

Redefinition of %s type from %s to %s

**Description:**

*Used when the type of a variable changes inside a method or a function.*

**Problematic code:**

.. literalinclude:: /data/messages/r/redefined-variable-type/bad.py
   :language: python

**Correct code:**

.. literalinclude:: /data/messages/r/redefined-variable-type/good.py
   :language: python




.. note::
  This message is emitted by the optional :ref:`'multiple_types'<pylint.extensions.redefined_variable_type>`
   checker which requires the ``pylint.extensions.redefined_variable_type`` plugin to be loaded.

Created by the `multiple_types <https://github.com/PyCQA/pylint/blob/main/pylint/extensions/redefined_variable_type.py>`__ checker.