.. _broken-noreturn:

broken-noreturn / E6004
=======================

**Message emitted:**

'NoReturn' inside compound types is broken in 3.7.0 / 3.7.1

**Description:**

*``typing.NoReturn`` inside compound types is broken in Python 3.7.0 and 3.7.1. If not dependent on runtime introspection, use string annotation instead. E.g. ``Callable[..., 'NoReturn']``. https://bugs.python.org/issue34921*

**Problematic code:**

.. literalinclude:: /data/messages/b/broken-noreturn/bad.py
   :language: python

**Correct code:**

.. literalinclude:: /data/messages/b/broken-noreturn/good.py
   :language: python




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

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