PY3.R1704

Redefined argument from local

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.

Noncompliant Code:

Copy
def show(host_id=10.11):
    for host_id, host in [[12.13, 'Venus'], [14.15, 'Mars']]:
        print(host_id, host)

Compliant Code:

Copy
def show(host_id=10.11):
    for inner_host_id, host in [[12.13, 'Venus'], [14.15, 'Mars']]:
        print(host_id, inner_host_id, host)

The content on this page is adapted from the Pylint User Guide, Copyright ©2003-2022, Logilab, PyCQA and contributors. All rights reserved. https://pylint.pycqa.org/en/latest/index.html#, and is used under the Python Software Foundation License Version 2. Examples, recipes, and other code in the Pylint documentation are additionally licensed under the Zero Clause BSD License.