def foo(a, b):
return a + b
def bar(c, d):
return c, d
HANDLERS = {
"foo": foo,
"bar": lambda a, b: bar(a, b) # "fixes" to just bar
}
def handle(verb: str, payload):
a, b = payload
return HANDLERS[verb](a=a, b=b)
Here we're relying on the lambda to implement renaming of positional arguments. Removing the lambda expression would be incorrect despite an absence of side-effects. A correct refactor would be to rename the arguments to bar, or to eliminate the keyword invocation but the linter fix alone is unsafe despite listing itself as such.