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.
_______________________________________________
Python-ideas mailing list -- python-ideas@python.org
To unsubscribe send an email to python-ideas-le...@python.org
https://mail.python.org/mailman3/lists/python-ideas.python.org/
Message archived at 
https://mail.python.org/archives/list/python-ideas@python.org/message/MSUFU6NSSC6CFAP43SB7MTWHFME66QWF/
Code of Conduct: http://python.org/psf/codeofconduct/

Reply via email to