.. _unnecessary-default-type-args: unnecessary-default-type-args / R6007 ===================================== **Message emitted:** ``Type `%s` has unnecessary default type args. Change it to `%s`.`` **Description:** *Emitted when types have default type args which can be omitted. Mainly used for `typing.Generator` and `typing.AsyncGenerator`.* **Problematic code:** .. literalinclude:: /data/messages/u/unnecessary-default-type-args/bad.py :language: python **Correct code:** .. literalinclude:: /data/messages/u/unnecessary-default-type-args/good.py :language: python **Configuration file:** .. literalinclude:: /data/messages/u/unnecessary-default-type-args/pylintrc :language: ini **Additional details:** At the moment, this check only works for ``Generator`` and ``AsyncGenerator``. Starting with Python 3.13, the ``SendType`` and ``ReturnType`` default to ``None``. As such it's no longer necessary to specify them. The ``collections.abc`` variants don't validate the number of type arguments. Therefore the defaults for these can be used in earlier versions as well. **Related links:** - `Python documentation for AsyncGenerator `_ - `Python documentation for Generator `_ .. note:: This message is emitted by the optional :ref:`'typing'` checker, which requires the ``pylint.extensions.typing`` plugin to be loaded. Created by the `typing `__ checker.