Skip to content

Incorrect check on string interpolation #1717

Description

@dmoisset

When sending this type-correct code

d = {"greeting": "hello", "count": 10}
print("%(greeting)s World. %(count)d%% tests failing" % d)

through mypy, I get the following:

error: String interpolation mixes specifier with and without mapping keys

Which should be accepted; the only interpolator I'm using withot keys is "%%" which is just an escape and can not cause problems

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugmypy got something wrong
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions