Default paranmeter for packed values

Gregory Ewing greg.ewing at canterbury.ac.nz
Mon Apr 19 02:10:01 EDT 2010


MRAB wrote:
> Xavier Ho wrote:
> 
>>> >> def t(a, *b = (3, 4)):
>>
>>   File "<input>", line 1
>>     def t(a, *b = (3, 4)):
>>                 ^
>> SyntaxError: invalid syntax
>>
>> What was the rationale behind this design?

The concept of a default value for the * argument doesn't
really apply, because there is always a value for it, even
if it's just an empty tuple.

-- 
Greg



More information about the Python-list mailing list