Timeline for Why doesn't Python allow multi-line lambdas?
Current License: CC BY-SA 3.0
12 events
| when toggle format | what | by | license | comment | |
|---|---|---|---|---|---|
| Dec 9, 2023 at 1:07 | comment | added | Andrew | I'll add this to my list of 10B reasons why Python should die out. | |
| Jun 16, 2020 at 10:01 | history | edited | CommunityBot | Commonmark migration | |
| Sep 15, 2019 at 17:39 | comment | added | aoeu256 | @contextmanager | |
| Jul 26, 2019 at 3:29 | comment | added | Christopher Barber | A def is a statement while a lambda is an expression so the name is clearly not the only difference. | |
| Aug 7, 2014 at 3:07 | comment | added | Siyuan Ren | @good_computer: The only difference between a lambda and a defed function is that the latter must have a name. Although I would like multi-expression lambda as well, it is not a must; it simply would make life a bit easier. | |
| Aug 7, 2011 at 19:56 | comment | added | btilly | @greengit: You do know that you can pass the function in as an argument to another function? You can't write it inline, but there is no programming technique that is not available to you. | |
| Aug 7, 2011 at 18:11 | vote | accept | treecoder | ||
| Aug 7, 2011 at 18:10 | comment | added | Jason Baker | @greengit - I think you're better off taking this up with GvR than posting your comments here. | |
| Aug 7, 2011 at 18:03 | comment | added | treecoder | nested defs don't help when passing functions as arguments -- that's the number one reason why i'd like multi-line lambds | |
| Aug 7, 2011 at 17:58 | comment | added | jsternberg | @greengit You can just use a nested def. It isn't the same as anonymous functions, but they're close enough. | |
| Aug 7, 2011 at 17:49 | comment | added | treecoder | +1 thanks for the thread link -- but i would still appreciate multi-line lambdas -- they are invaluable -- look at JavaScript, PHP has them included also. | |
| Aug 7, 2011 at 17:39 | history | answered | BlackJack | CC BY-SA 3.0 |