[Tutor] Multiple inheritance - almost correct, I think

Alan Gauld alan.gauld at yahoo.co.uk
Fri May 14 06:33:54 EDT 2021


On 14/05/2021 10:53, Phil wrote:

> classMyForm(wx.Frame, Meter):
> def__init__(self):
> wx.Frame.__init__(self, None, wx.ID_ANY, "Meter Test", size=(300, 300))
> Meter.__init__(self, Meter.start_x)

As per my other post, you cannot do this. Meter.start_x
does not exist at this point. it is created inside Meter.init()
and uses the value passed into init to initialize itself.


-- 
Alan G
Author of the Learn to Program web site
http://www.alan-g.me.uk/
http://www.amazon.com/author/alan_gauld
Follow my photo-blog on Flickr at:
http://www.flickr.com/photos/alangauldphotos




More information about the Tutor mailing list