PY3.W1114

Arguments out of order

Emitted when the caller's argument names fully match the parameter names in the function signature but do not have the same order.

Noncompliant Code:

Copy
def function_3_args(first_argument, second_argument, third_argument):
    """Three arguments function"""
    return first_argument, second_argument, third_argument


def args_out_of_order():
    first_argument = 1
    second_argument = 2
    third_argument = 3

    function_3_args(  # [arguments-out-of-order]
        first_argument, third_argument, second_argument
    )

Compliant Code:

Copy
def function_3_args(first_argument, second_argument, third_argument):
    """Three arguments function"""
    return first_argument, second_argument, third_argument


def args_out_of_order():
    first_argument = 1
    second_argument = 2
    third_argument = 3

    function_3_args(first_argument, second_argument, third_argument)

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.