Re:Zed finishes Learn Python The Hard Way
by zedshaw on Wednesday September 29, 2010 @01:52PM
(#1740336)
You are not mistaken, there is no chapter on functional programming. Why? Because "The Little Schemer" is a way better book for teaching better functional programming than I could possibly do in a Python book. Python's functional concepts are just not really that great, so I couldn't explain them very well.
[ Parent
| on HN ]
Re:Zed finishes Learn Python The Hard Way
by illumen on Thursday September 30, 2010 @06:54AM
(#1742864)
If you're not teaching pythons functional concepts, then you're not teaching python.
However I think you have accidentally... consider this short example which shows off first class functions, map, reduce, no side effects, and filtering.
[(lambda a,b,p:(a+p,b+p))(x,y,2) for x in (1,4) for y in (10,15,22) if x*y > 25]
Python does functional programming without people even knowing that it is functional programming :)