4 ms·
Itertools - Iterator functions for efficient looping
- fragmede 16y ago"A Python programmer discovering the magic of itertools is three months from looking for a new language that better supports the functional style." -Andrew Brehaut
- hga 16y agoSee also http://news.ycombinator.com/item?id=1319092 http://news.ycombinator.com/item?id=1319092.
- KirinDave 16y agoParticularly poignant with Python, since Python has refused real lambdas for years now. Result of that decision: in the name of simplicity, increasingly complex iteration tool chains spring into existence.
- jules 16y agoAnd sometimes you have to jump through hoops to avoid iterating over the same iterator twice.
- rbanffy 16y agoIf Guido made Python into Lisp, what would be the point of making it? Different languages have different strengths. And weaknesses. Reminding myself I have learned to program on a Texas Instruments' TI-51 III shows me it's the programmer that makes the machine tick. Learning to program on something that can't make a conditional jump (or jump somewhere but program step 0) is educational.
- KirinDave 16y agoThis is sort of orthogonal to the complaint. Why have partial lambda support at all? The argument is: keeping out real lambdas makes Python easier (both in terms of implementation and learning). But increasingly it seems like this decision has not really helped either of these goals. So yeah, different language is different. That doesn't excuse the absurdity of the justification. If python had real lambdas, it'd still have a lot of unique syntax and libraries that would keep it distinct and relevant.
- jedbrown 16y agoThe source of that quote is a nice read: http://brehaut.net/blog/2010/on_iteration http://brehaut.net/blog/2010/on_iteration