[Tutor] Functional Programming in Python

WolfRage wolfrage8765 at gmail.com
Thu Apr 2 21:39:24 CEST 2015


On 04/02/2015 02:52 PM, Danny Yoo wrote:
<SNIP>
> This is not to say that closures are bad.  It's just to point out that
> just because functional programs use closures quite a lot, doesn't
> automatically mean closures are the most appropriate tool for
> everything.  If there are parts of the language that already do the
> sort of thing you're trying to accomplish, it might be good to reuse
> those parts, rather than reinvent the universe.
I agree that closures are not the best tool for every job. And in the 
case of a callback based GUI they simply do not work, since execution 
needs to leave a function in order to run the GUI's main loop. Thus I 
abused a coroutine.



More information about the Tutor mailing list