mixed-format-string / E1302#

Message emitted:

Mixing named and unnamed conversion specifiers in format string


Used when a format string contains both named (e.g. '%(foo)d') and unnamed (e.g. '%d') conversion specifiers. This is also used when a named conversion specifier contains * for the minimum field width and/or precision.

Correct code:

print("x=%d, y=%d" % (0, 1))
print("x=%(x)d, y=%(y)d" % {"x": 0, "y": 1})

Problematic code:

print("x=%(x)d, y=%d" % (0, 1))  # [mixed-format-string]

Created by the string checker.