
Oct. 24, 2003
12:37 p.m.
Tim> squares = (f(x)**2 for x in inputs) # assuming reiterability here Tim> for f in math.sin, math.cos, math.tan: Tim> plot(squares) How much more expensive would this be than for f in math.sin, math.cos, math.tan: squares = (f(x)**2 for x in inputs) plot(squares) which would work without reiterability, right? The underlying generator function could still be created at compile-time and it (or its code object?) stored in the current function's constants. 'f' is simply an argument to it when the iterator is instantiated. Skip