[Solved] PEP 8 warning “Do not use a lambda expression use a def” for a defaultdict lambda expression [duplicate]
A lambda in Python is essentially an anonymous function with awkward restricted syntax; the warning is just saying that, given that you are assigning it straight to a variable – thus giving the lambda a name -, you could just use a def, which has clearer syntax and bakes the function name in the function … Read more