4 ms·
You can still do anything you want with just Python lambdas technically speaking right? Like, Python lambdas can express any lambda calculus expression, so as l
by knightoffaith 3y ago
You can still do anything you want with just Python lambdas technically speaking right? Like, Python lambdas can express any lambda calculus expression, so as long as you're not writing something with side effects, you can use an arbitrarily complex Python lambda. Though I guess the resulting code wouldn't exactly be Pythonic.
- constantcrying 3y agoLanguage design is really about what you could do, but about how to efficiently express certain things.
- JadeNB 3y ago> Language design is really about what you could do, but about how to efficiently express certain things. That's missing a "not", right (probably after "really")?
- ElevenLathe 3y agoNot the person you're replying to, but I assume they meant "rarely" instead of "really". I make this typo all the time myself!
- JadeNB 3y agoThat makes sense. Thanks!
- powersnail 3y agoDepends on what you mean by "technically". Computationally, python lambda is fully capable of whatever a regular python function can do, including side-effects, (you can call foo.set_bar()). The limit is syntactical: a lambda has to be one single expression. So, no assignment statement, no multiple lines, etc.