method (a, b = '', *c, **d): gets a syntax error?

Andreas Neudecker a.neudecker at uni-bonn.de
Fri Aug 29 10:33:49 EDT 2003


Hello.

I am relatively new to Python and I have a strange problem with some 
code. In a class the __call__ method gets parameters like this:


class WhatsUp:
     __call__ (
            self,
            var1,
            var2 = '',
            *moreVars,
            **moreNamedVars,
         ):
         pass


I always get an error for the **moreNamedVars, line where the '^' points 
at the comma at the end (or, if I remove the comma, it points at the 
colon). I also tried commenting-out the other variables passed to the 
method. Same result.
I assumed the order of variables and variable lists of variables had to 
be like this? What is wrong?


Kind regards



Andreas







More information about the Python-list mailing list