.. _consider-alternative-union-syntax:

consider-alternative-union-syntax / R6003
=========================================

**Message emitted:**

Consider using alternative Union syntax instead of '%s'%s

**Description:**

*Emitted when 'typing.Union' or 'typing.Optional' is used instead of the alternative Union syntax 'int | None'.*


**Correct code:**

.. literalinclude:: /data/messages/c/consider-alternative-union-syntax/good.py
   :language: python

**Additional details:**

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



.. 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.