.. _bad-string-format-type:

bad-string-format-type / E1307
==============================

**Message emitted:**

Argument %r does not match format type %r

**Description:**

*Used when a type required by format string is not suitable for actual argument type*

**Problematic code:**

.. literalinclude:: /data/messages/b/bad-string-format-type/bad.py
   :language: python

**Correct code:**

.. literalinclude:: /data/messages/b/bad-string-format-type/good.py
   :language: python

**Additional details:**

This check is currently only active for "old-style" string formatting as seen in the examples.
See `Issue #6085 <https://github.com/PyCQA/pylint/issues/6163>`_ for more information.

**Related links:**

- `Format String Syntax <https://docs.python.org/3/library/string.html#formatstrings>`_
- `PyFormat <https://pyformat.info/>`_

Created by the `string <https://github.com/PyCQA/pylint/blob/main/pylint/checkers/strings.py>`__ checker.