
Itertools - Iterator functions for efficient looping - mshafrir
http://www.doughellmann.com/PyMOTW/itertools/
======
fragmede
"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
See also <http://news.ycombinator.com/item?id=1319092>.

~~~
KirinDave
Particularly 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
And sometimes you have to jump through hoops to avoid iterating over the same
iterator twice.

~~~
rbanffy
If 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
This 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.

~~~
rbanffy
The ease of learning argument can be simply countered by not teaching lambdas
in the first place.

For many use cases, a named function works well.

~~~
KirinDave
I don't agree, but that doesn't matter. What's most curious is why a halfway
measure is supported at all.

