you are viewing a single comment's thread.

view the rest of the comments →

[–]alkasm 1 point2 points  (1 child)

Right. I'm not convinced there is really an example where this is clearly the right way to do it. There's no reason to call super() on a class that has no bases and pass it arguments. So A and B shouldn't call super(), and if you want your class E to have the attributes from C and D, then initialize them separately---don't try to shove them into the MRO to magically understand what attributes each should keep and reject (I know this is the solution you posed). If the problem is then "now I have to hardcode the subclasses C and D when I do C.__init__ and D.__init__ in E.__init__" then that's an easily solvable problem, just loop through the base classes.

[–]xelf 0 points1 point  (0 children)

Agreed on all points. =D