4 ms·
Even if Python used the anonymous function syntax proposed, people would still call them "lambdas". If you want to have aa keyword for this, you might as well n
by moleperson 4y ago
Even if Python used the anonymous function syntax proposed, people would still call them "lambdas". If you want to have aa keyword for this, you might as well name it after what most people are going to type into Google when searching for it.
- rurban 4y agoNot necessarily. In Perl we called lambda "anonymous sub" for ages, and nobody mixed those up. We also use a handy keyword less syntax to generate, store and use such lambda's. Thus I'm on the "Worse is Better" side, python cannot write proper compilers and cannot decide on proper syntax. lambda: sub($x) {$x+1} decl sub{shift+1}(args) call or ruby-like: {shift+1}->list