
Steven D'Aprano writes:
I think that where malmiteria gets it wrong is that he thinks that super is broken I do not, i think its design could be improved overall, but i don't think it's broken. At best I'd argue it can't be used in all of the use case you'd expect for it.
Changing super would be tantamount to banning MI I think my overall proposal accounts for ML pretty well, and i definitely do not intend on removing ML from python. I actually believe my proposal would allow for more ML, as some inheritance trees today are not allowed, and my proposal would allow them.
and that would be a massively backwards incompatible breaking change Not so much, actually, standard simple inheritance scenario would be essentially unchanged. The change to mixin would require this kind of change: From:
class MyView(LoginRequiredMixin, PermissionMixin, View):
...
To: ``` class MyView( LoginRequiredMixin( PermissionMixin( View ) ) ): ... ``` And that's it, no big deal The eventual diamond case would be covered by the strategy module, allowing for multiple diamond case strategy, the default one could match today's behavior, so those case would be virtually unchanged. The eventual dependency injection... btw, when i talk about dependency injection, i mean, in the inheritance tree, which allows to mock individual classes in the inheritance tree, for example. So, those scenarios, they could be covered by the alterhitance module i describe in my long post (which would allow to alter inheritance trees by modifying the __bases__ classes attribute) Arguably, those would require the most change. I'm not aware of any actual occurence of this use case in any code tho, so it's hard for me to evaluate how big a deal it might be.