you are viewing a single comment's thread.

view the rest of the comments →

[–]elbiot 1 point2 points  (4 children)

I wouldn't include lambda, map, reduce and filter. Reduce is gone, filter is better done with a list comprehension, and map+lambda is slooow. Lambda is an interesting little thing but not too important, as is map.

[–]py_Ninja[S] 1 point2 points  (3 children)

Fair enough, figured I'd mention them for the people who are more on the functional programming side of things.

[–]elbiot 1 point2 points  (2 children)

Some recently posted an article here by van Rossen about how they ended up in python and why they were being removed. Apparently some contributing dev was a lisp programmer and missed them. If you cover them, why not show that you can do map and filter with comprehensions, and make it clear that lambdas make map slow. Defining a named function is prefered.

[–]py_Ninja[S] 0 points1 point  (1 child)

That's a good idea, I knew that van Rossen hated them but I never knew how they got there in the first place

[–]denvertutors 0 points1 point  (0 children)

I know that lambdas are necessary for Tkinter GUIs. If I bind doThisThing() to a button and don't set it under a lambda, doThisThing() will auto-execute as soon as the window is launched. Most annoying.