.. _too-many-positional-arguments: too-many-positional-arguments / R0917 ===================================== **Message emitted:** ``Too many positional arguments (%s/%s)`` **Description:** *Used when a function has too many positional arguments.* **Problematic code:** .. literalinclude:: /data/messages/t/too-many-positional-arguments/bad.py :language: python **Correct code:** .. literalinclude:: /data/messages/t/too-many-positional-arguments/good.py :language: python **Configuration file:** .. literalinclude:: /data/messages/t/too-many-positional-arguments/pylintrc :language: ini **Additional details:** Positional arguments work well for cases where the the use cases are self-evident, such as unittest's ``assertEqual(first, second, msg=None)``. Comprehensibility suffers beyond a handful of arguments, though, so for functions that take more inputs, require that additional arguments be passed by *keyword only* by preceding them with ``*``: .. code-block:: python def make_noise(self, volume, *, color=noise.PINK, debug=True): ... **Related links:** - `Ruff discussion `_ - `Pylint issue `_ Created by the `design `__ checker.