pylint-errors

R1704 (redefined-argument-from-local)

:x: Problematic code:

def main(host_id="test"):
    for host_id, host in [[1, 2]]:
        print(host_id, host)

:heavy_check_mark: Correct code:

def main(host_id="test"):
    for h_id, host in [[1, 2]]:
        print(host_id, h_id, host)

Rationale:

Used when a local name is redefining an argument, which might suggest a potential error. This is taken in account only for a handful of name binding operations, such as for iteration, with statement assignment and exception handler assignment.