[Python-ideas] MRO local precedence ordering revisited

Greg Ewing greg.ewing at canterbury.ac.nz
Thu Dec 10 18:19:33 EST 2015


Stephan Sahm wrote:
> my own intuitiv MRO would not be 
> anything proposed so far, but:
> 
> (B, mixin, A, mixin, object)
> 
> As you haven't mentioned this as a possibility at all, I guess having a 
> class twice in this list produces some weird behaviour I do not know 
> about yet - if someone can point out, that would be great.

I'm not sure what that would do to super calls. It's possible
you would end up in a loop from Mixin -> A -> Mixin -> A -> ...

But in any case, this MRO doesn't solve the fundamental
problem that the MROs of B and A are inherently contradictory.
*You* know what MRO you want in this particular case, but
there's no way for Python to know that.

-- 
Greg


More information about the Python-ideas mailing list