"Primoz Skale" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] | def f(*a=(0,)): | print a[0] #this should come next, but we get error msg instead, saying | | SyntaxError: invalid syntax | | but it does not work this way. Now my 'newbie' question: Why not? :)
Possibly because no one ever thought of that. More likely because it is contradictory: by definition, *a *always* gets a value, so there is never a need for a 'default'. When a param gets a value you don't like, you have to explicitly replace it or whatever. So add at the top 'a = a or (0,)' tjr -- http://mail.python.org/mailman/listinfo/python-list