I knew there was a way to better implement flatmap - its a combination
of itertools.chain.from_iterable and map. Here's a much cleaner code
from itertools import chain
print filter(lambda (x,y,z) : x*x + y*y == z*z,
chain.from_iterable(map(
lambda x: chain.from_iterable(map(
On Mon, Aug 1, 2011 at 8:30 PM, Anand Chitipothu anandol...@gmail.com wrote:
I knew there was a way to better implement flatmap - its a combination
of itertools.chain.from_iterable and map. Here's a much cleaner code
from itertools import chain
print filter(lambda (x,y,z) : x*x + y*y == z*z,
On Mon, Aug 1, 2011 at 8:30 PM, Anand Chitipothu anandol...@gmail.com wrote:
I was trying to translate Python list-comprehensions into Javascript
and here is what I've come up with.
$pyjs.listcomp(
function(x, y, z) { return [x, y, z]},
[
range(1, 100),
function(x) {