Xavier Ho wrote:
G'day Pythoneers,

I ran into a strange problem today: why does Python not allow default paranmeters for packed arguments in a function def?

>> def test(a = 1, b = (2, 3)):
...     print a, b
...
>> test()
1 (2, 3)

>> 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?

Perhaps it was that no-one ever thought of doing that! :-)
--
http://mail.python.org/mailman/listinfo/python-list

Reply via email to