.. _used-prior-global-declaration:

used-prior-global-declaration / E0118
=====================================

**Message emitted:**

Name %r is used prior to global declaration

**Description:**

*Emitted when a name is used prior a global declaration, which results in an error since Python 3.6.*

**Problematic code:**

.. literalinclude:: /data/messages/u/used-prior-global-declaration/bad.py
   :language: python

**Correct code:**

.. literalinclude:: /data/messages/u/used-prior-global-declaration/good.py
   :language: python



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