4 ms·
I dug up that “old email from 10 years ago” which I hadn’t seen before. Guido laid out the challenges of multiline lambdas on a mailing list [1] and then follo
by divbzero 6y ago
I dug up that “old email from 10 years ago” which I hadn’t seen before.
Guido laid out the challenges of multiline lambdas on a mailing list [1] and then followed up with a blog post [2] [3]. His chain of thought is worth reading in full, but the crux is lack of “Pythonicity” and his gut feel that named functions avoid the complexity and possible ambiguity of multiline lambdas:
def callback(x, y):
print x
print y
a = foo(callback)
[1]: https://mail.python.org/pipermail/python-dev/2006-February/060621.html https://mail.python.org/pipermail/python-dev/2006-February/0... "[Python-Dev] Let's just keep lambda"
[2]: https://www.artima.com/weblogs/viewpost.jsp?thread=147358 https://www.artima.com/weblogs/viewpost.jsp?thread=147358 "Language Design Is Not Just Solving Puzzles"
[3]: https://news.ycombinator.com/item?id=20672739 https://news.ycombinator.com/item?id=20672739 "Language Design Is Not Just Solving Puzzles (2006) | Hacker News"
- heavyset_go 6y agoThanks for putting this together.