[wxPython-users] Parameters To wx.Frame subclass __init__

Christopher Barker Chris.Barker at noaa.gov
Thu Dec 13 09:31:44 PST 2007


Mark Erbaugh wrote:
> def __init__(self, args, *kwds):

Isn't that:

*args, **kwargs ???

but the question is the same.

> If I pass my additional parameter as named parameter, wx complains about
> an unexpected parameter, which is reasonable. Do I need to remove my
> parameter from the kwds dict? before calling
> 
> wx.Frame.__init__(self, args, *kwds)

yes, you do. It's not a bad way to do, though perhaps a bit less clear 
than adding the parameter explicitly as suggested by Stephen.

Stephen Hansen wrote:
> personally I 
> just... find it bizarre if the first and second argument to a control 
> isn't Parent and ID. :) 

A mostly agree about parent, but not ID -- I try not to ever specify IDs 
anyway.

-Chris


-- 
Christopher Barker, Ph.D.
Oceanographer

Emergency Response Division
NOAA/NOS/OR&R            (206) 526-6959   voice
7600 Sand Point Way NE   (206) 526-6329   fax
Seattle, WA  98115       (206) 526-6317   main reception

Chris.Barker at noaa.gov




More information about the wxpython-users mailing list