Isn't this essentially what list comprehensions are for? For instance, here's the Pythagorean triple example using a comprehension:<p><pre><code> [(a, b, c) for a in range(1, 11) for b in range(1, 11) for c in range(1, 11) if a ** 2 + b ** 2 == c ** 2]
</code></pre>
I understand that the semantics are slightly different, but I'd argue that the benefit of using a built-in, idiomatic Python construct instead of reinventing the wheel is pretty clear.<p>Or am I missing something?