bf3083c pylint: Fix unnecessary-lambda-assignment

6 files Authored by slev 2 years ago, Committed by frenaud 2 years ago,
    pylint: Fix unnecessary-lambda-assignment
    
    https://pylint.pycqa.org/en/latest/user_guide/messages/convention/unnecessary-lambda-assignment.html:
    > Used when a lambda expression is assigned to variable rather than
    defining a standard function with the "def" keyword.
    
    https://peps.python.org/pep-0008/#programming-recommendations:
    > Always use a def statement instead of an assignment statement that
    binds a lambda expression directly to an identifier:
    def f(x): return 2*x
    f = lambda x: 2*x
    The first form means that the name of the resulting function object is
    specifically ‘f’ instead of the generic ‘<lambda>’. This is more useful
    for tracebacks and string representations in general. The use of the
    assignment statement eliminates the sole benefit a lambda expression can
    offer over an explicit def statement (i.e. that it can be embedded
    inside a larger expression)
    
    Fixes: https://pagure.io/freeipa/issue/9278
    Signed-off-by: Stanislav Levin <slev@altlinux.org>
    Reviewed-By: Stanislav Levin <slev@altlinux.org>
    
        
file modified
+11 -3
file modified
+9 -6
file modified
+8 -3
file modified
+0 -1