Aw: Re: Aw: Functional style programming in python: what will you talk about if you have an hour on this topic?

Anthony Kong anthony.hw.kong at gmail.com
Mon Jul 18 08:20:46 EDT 2011


Thanks for all the great suggestion. 

First of all, Carl is right that it does not take much to impress a java programmer about the expressiveness of functional programming.

Covered map, reduce and filter as Rainer suggested.

Emphasized the advantages of functional style as summarised by Steve D'Aprano. 

I showcased the use of groupby() in itertools. Think about what it takes to implement similar logic in Java. Also introduced the gotcha of using groupby(): you must first sort the list in the same way you want to group them by.


Then I got ambitious and tried to introduce partial(). I basically lost everyone right there. They can understand what partial does but do not know why it can be useful. My example was too trivial and it did not help.


What is the best way to introduce partial/currying? 






More information about the Python-list mailing list