3 ms·
> Regular functions definitions can't be used as expressions I’m having a difficult time understanding what you mean here. Can you offer an example? I have ne
by whalesalad 7y ago
> Regular functions definitions can't be used as expressions
I’m having a difficult time understanding what you mean here. Can you offer an example?
I have never felt compelled to write a multi line lambda.
- dwaltrip 7y agoPython can't replicate the structure of this JavaScript code: fooBaz(x => { // multiple lines of logic }) In python, you are forced to move the logic away from the point of usage, which means you lose some locality. This loss is sometimes not worth getting a "name" for the logic. Of course, sometimes it is better to create a named function away from the point of usage, but I don't think that is always the case.