Skip to content

Update UP032 to handle repeated indices/keywords  #6217

@harupy

Description

@harupy

Example:

x = 1
print("{0} and {0}".format(x))
print("{a} and {a}".format(a=x))

Expected behavior:

UP032 is raised and the code is fixed to:

x = 1
print(f"{x} and {x}")
print(f"{x} and {x}")

Actual behavior:

UP032 is not raised (playground)

Metadata

Metadata

Assignees

No one assigned

    Labels

    acceptedReady for implementationruleImplementing or modifying a lint rule

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions