[Tutor] Listing function arguments
alan.gauld at blueyonder.co.uk
Wed Sep 1 22:56:53 CEST 2004
> Is there a way to list the arguments that a variable is accepting?
> For instance, the first line of a function looks like this:
> def cmcopy( aClients = , sSource = '', sTarget = '', iSource =
> So I'd like to know the argument names, for
> 1- Know the order at wich the arguments must be passed
> 2- Know what variables to supply for arguments
Lets get our terminology straight first.
aClients, aSource etc are the parameter names of the function cmcopy
If I do:
L = [1,2,3]
s = 'fred'
t = 'tom'
src = 42
The variable names are: L, s, t, src
but the *arguments* are just the values that those variables hold
and they are assined the temporary names
aClients, sSource, sTarget, iSource
for the duration of the function call.
Thus if I do:
There are no argument names, but the argument values are:
Almost exactly as they were above (except that the lists are not
also referenced by the variables!)
Which names do you want? And what dso you think you can do with them?
If we know what you are trying to achieve we might be able to offer
a better solution. :-)
More information about the Tutor