The python implementation looks overly complicated. I was thinking that the ruby and python implementations would be very similar. Here it goes
def foo(n):
return lambda i:n+i
Tried it (Python 2.5) and it works.