do you master list comprehensions?

Will Stuyvesant hwlgw at hotmail.com
Tue Dec 14 08:56:18 EST 2004


Okay that was fun.  Enlightening as I hoped.  unroll() in Python, for
arbitrary depth, _flatten in Tkinter (what else is in Tkinter!), sum()
abuse.

The sum(data,[]) was funniest, it works like ((['foo','bar'] + []) +
['my','your']) + ['holy','grail'].  Before I think of such things I
have already coded an algorithm in imperative style.  Guess I have not
been exposed to functional programming enough.




More information about the Python-list mailing list