.. _redefined-outer-name:

redefined-outer-name / W0621
============================

**Message emitted:**

Redefining name %r from outer scope (line %s)

**Description:**

*Used when a variable's name hides a name defined in an outer scope or except handler.*


**Correct code:**

.. literalinclude:: /data/messages/r/redefined-outer-name/good.py
   :language: python

**Additional details:**

You can help us make the doc better `by contributing <https://github.com/PyCQA/pylint/issues/5953>`_ !


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