[Tutor] Multiple inheritance - Need clarity

Alan Gauld alan.gauld at yahoo.co.uk
Sat Nov 27 06:06:10 EST 2021


On 27/11/2021 03:14, Dennis Lee Bieber wrote:

> 	But with your multiple inheritance, you would have to explicitly call 
> 		
> 	top_bottom_area = 2 * Circle.area()
> 	column_area = Rectangle.area()
> 
> as using super... will only call the first item in the MRO.

Ah, good point. My recommendation to use super() here was
misplaced. You need to call both.

-- 
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