4 ms·
What’s awkward about lambda in python?
by wallscratch 5y ago
What’s awkward about lambda in python?
- namelosw 5y ago- No multi-line support - Gets very messy when nested And SICP is a book about learning computer science by abusing lambdas.
- senkora 5y agoPython is based on mainly on statements rather than expressions, and lambdas can’t have multiple statements, so writing lambdas is different from writing normal Python code. In a very real sense, there is no idiomatic way to write complex lambdas in Python. What you would do instead is define a named function and pass it in as an argument. This is fine but definitely more complicated.