2 ms·
What a shame it would be if he'd removed it. Pyspark now makes great use of lambdas, and I'd strongly argue that having to name every function argument would be
by Psyonic 11y ago
What a shame it would be if he'd removed it. Pyspark now makes great use of lambdas, and I'd strongly argue that having to name every function argument would be strictly worse.
- dalke 11y agoTk developers have long agreed with you, because it really is easier to say Button(frame, text="abc", command=lambda: self.highlight("abc")) than to make a function for each command. The loose consensus in Python is that lambdas are best when they fit on a line, which is what the examples at http://www.mccarroll.net/blog/pyspark2/index.html http://www.mccarroll.net/blog/pyspark2/index.html do. Otherwise, make a named function. I think arguments like this are one of the main reasons why van Rossum has kept lambda in the language.