4 ms·
I think it makes more sense in a language where you have to write callbacks all the time. I consider it a feature in Python, because by using `def` you're force
by nicolashahn 8y ago
I think it makes more sense in a language where you have to write callbacks all the time. I consider it a feature in Python, because by using `def` you're forced to imbue the function with meaning by providing it a name. Otherwise, it's just reading through a potentially complicated function without any context of what it's supposed to be doing.
- Too 8y agoAll languages, including python, where you do a lot of asynchronous io require callbacks all the time. It's only recently python got await-support to deal with this. Single line lambdas is a real PITA when your not using asyncio and python maintainers have said they don't plan to change it :(
- deleted 8y ago[deleted]
- saagarjha 8y agoIt also makes sense if you're trying to do any sort of functional programming.
- xapata 8y agoI use Python for functional programming and I don't miss multiline lambdas. I have a large monitor, so vertical space isn't at a premium for me.