Thanks for the tips.  Making FW a callable class (choice 5) seems to be
a good (if verbose) solution.  I might just wrap my temporary values in
a list [lastX, lastA, lastB] and mutate them as Michael suggests.
Thanks to Michael especially for the explanation of the name-binding
process that's at the heart of the issue.

The other choicess are not as helpful to me for the following reasons:

choice 1: I don't want the temporary values of lastA and lastB to be
global variables in my case as they are great big numeric arrays, and
I'd like their memory to be reclaimed after FW is done.

choice 2:  I tried this without success.  Using Micheal's example, I
would assume you mean something like this:

def outer():
    b = 1
    def inner():
        outer.b += 1
        print outer.b
    inner()
outer()

Which gives me:
AttributeError: 'function' object has no attribute 'b'

Perhaps I misapplied this method?

choice 3:  I know that Python can return multiple values in one line,
but I don't think that applies here.  My library function F, is looking
for two separate function arguments

-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to