Ricardo Aráoz wrote:
> Ayaz Ahmed Khan wrote:
>
>> "James Stroud" typed:
>>
>>> py> def doit(a, b, c, x=14):
>>> ... pass
>>> ...
>>> py> doit.func_code.co_argcount
>>> 4
>>> py> doit.func_code.co_varnames
>>> ('a', 'b', 'c', 'x')
>>> py> doit.func_defaults
>>> (14,)
>>>
>> Neat.
>
Ayaz Ahmed Khan wrote:
> "James Stroud" typed:
>> py> def doit(a, b, c, x=14):
>> ... pass
>> ...
>> py> doit.func_code.co_argcount
>> 4
>> py> doit.func_code.co_varnames
>> ('a', 'b', 'c', 'x')
>> py> doit.func_defaults
>> (14,)
>
> Neat.
>
How do you know the 14 corresponds to x ?
--
http
"James Stroud" typed:
> py> def doit(a, b, c, x=14):
> ... pass
> ...
> py> doit.func_code.co_argcount
> 4
> py> doit.func_code.co_varnames
> ('a', 'b', 'c', 'x')
> py> doit.func_defaults
> (14,)
Neat.
--
Ayaz Ahmed Khan
I have not yet begun to byte!
--
http://mail.python.org/mailman/listinf
yagyala wrote:
> Hi. I would like to be able to tell, at run time, how many parameters
> a function requires. Ideally I would like to be able to tell which are
> optional as well. I've tried looking at the functions attributes, but
> haven't found one that helps in this. How can I do this?
>
> Tha
yagyala a écrit :
> Hi. I would like to be able to tell, at run time, how many parameters
> a function requires. Ideally I would like to be able to tell which are
> optional as well. I've tried looking at the functions attributes, but
> haven't found one that helps in this. How can I do this?
>>>
yagyala wrote:
> Hi. I would like to be able to tell, at run time, how many parameters
> a function requires. Ideally I would like to be able to tell which are
> optional as well. I've tried looking at the functions attributes, but
> haven't found one that helps in this. How can I do this?
>
> Tha
yagyala wrote:
> Hi. I would like to be able to tell, at run time, how many parameters
> a function requires. Ideally I would like to be able to tell which are
> optional as well. I've tried looking at the functions attributes, but
> haven't found one that helps in this. How can I do this?
>
I'v