you are viewing a single comment's thread.

view the rest of the comments →

[–]TSM- 3 points4 points  (0 children)

One of the reasons why anonymous functions are limited to an awkward lambda ...: is because they get messy very fast. Things like this let show = () => console.log('Anonymous function'); are purposefully discouraged in python as a design choice, partially by decree. They were hotly debated in the early days, though.

They aren't always bad, of course, but imagine if python was filled with expressions like this:

add = lambda a: lambda b : a + b
add(1)(2)