input parameters dependcy?

Gang Li gang.li at compuware.com
Thu Nov 4 22:21:14 CET 1999


How can I know which inpute parameters will be used in a function, before
call the function.  e.g. If I have a function

def foo(self, var1, var2):
    a = self.left
    b = var1+var2
    c = a + self.top
    return  a,b,c

module test1 as following

g1 = [3]
g2 = [4]

class CL:
    __init__(self, l, t):
        self.left = l
        self.top = t

cl = CL(100, 20)

tt = foo(cl, g1, g2)

Before the call foo(cl, g1, g2), from the code of foo, I know cl.top,
cl.left, g1 and g2 will be used.  How can I detect which variables will be
used give the call condition foo(cl,g1,g2) before call it?






More information about the Python-list mailing list