.. _broken-collections-callable:

broken-collections-callable / E6005
===================================

**Message emitted:**

'collections.abc.Callable' inside Optional and Union is broken in 3.9.0 / 3.9.1 (use 'typing.Callable' instead)

**Description:**

*``collections.abc.Callable`` inside Optional and Union is broken in Python 3.9.0 and 3.9.1. Use ``typing.Callable`` for these cases instead. https://bugs.python.org/issue42965*

**Problematic code:**

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

**Correct code:**

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


**Related links:**

- `bpo-42965 <https://bugs.python.org/issue42965>`_


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