cookedm+news at physics.mcmaster.ca (David M. Cooke) writes:
>The lambda depends on a global variable too (or at least, a variable>up one scope).
That's quite a significant difference. The *result* of the lambda
does not depend on a global variable.
>def make_translation_function(GCPs, type, invert=False):> if type == 'LSF' and len(GCPs) < 12:> # Do lots of time-consuming magic to calculate A, B, ...> def LSF_function(x, y):> xy = x*y> lon = x*A + y*B + xy*C + ...> lat = x*G + y*H + xy*I + ...> return (lon, lat)> return LSF_function
Ah...*that's* what I needed. I hadn't considered that a defined
function could be passed out of the scope like that.