[wxPython-users] Re: name space misunderstanding
Paul Koning
pkoning at equallogic.com
Fri Dec 15 08:20:25 PST 2006
>>>>> "Donn" == Donn Ingle <donn.ingle at gmail.com> writes:
>> editor.EditorNotebook(parent=self,id=-1,style=wx.NB_LEFT) I get a
>> TypeError: __init__() got an unexpected keyword argument 'style'
>> Yet if I look at the code, style is there ...
Donn> I have seen this in other places. As far as I know it means the
Donn> function is not expecting **kwargs, only an argument list. So,
Donn> try dropping the style= part.
Something doesn't sound quite right here. The Python syntax rule is
that any optional argument can be specified either positionally, or by
keyword. Yes, you often see keyword args when **kwargs is present in
the function definition, but from what I read in the book, that isn't
the only place where it's allowed.
Or is the problem that the function definition effectively has a *args
argument?
paul
More information about the wxpython-users
mailing list