"Brendan" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] >F -is- in fact an iterative optimizer that minimizes A on x (B is the > derivative of A). So yes, F will call A and B on mulitple 'x's. In > that case, it seems the mutable object trick is the way to go. Thanks.
As long as it calls A and B in that same order, rather than A several times and B several times, then my code, fleshed out, will probably work. > > I didn't follow your last sentence. What about the Python Cookbook? It is a book that is one place to find memoizer code which allows one to save several x,f(x) pairs at once for later reuse. But you don't seem to need it since an optimizer should never return to the exact same x except by accident. Terry J. Reedy -- http://mail.python.org/mailman/listinfo/python-list