Title: Inheriting twice from the same Java interface causes MRO problems
Type: crash Severity: major
Components: Core Versions: 2.5.1
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: pjenvey Nosy List: alex.gronholm, cgroves, pjenvey
Priority: Keywords:

Created on 2009-11-13.13:21:41 by alex.gronholm, last changed 2009-11-25.08:48:28 by pjenvey.

msg5310 (view) Author: Alex Grönholm (alex.gronholm) Date: 2009-11-13.13:21:40
Seems like inheriting from the same interface twice causes problems.
ComboBoxModel is a subinterface of ListModel.
The following code should work but doesn't:

from javax.swing import ListModel
from javax.swing import ComboBoxModel

class A(ListModel): pass
class B(A, ComboBoxModel): pass
class C(B): pass

TypeError: Error when calling the metaclass bases
    Cannot create a consistent method resolution
order (MRO) for bases B[<class '__main__.A'>, <type

What I really can't understand is why it only barfs at "class C(...)"
and not when creating the "problem" type (B).
msg5324 (view) Author: Philip Jenvey (pjenvey) Date: 2009-11-25.08:48:27
The root cause of this was B's mro incorrectly contained B's proxy class 
twice. This is fixed in r6950
Date User Action Args
2009-11-25 08:48:28pjenveysetstatus: open -> closed
resolution: fixed
messages: + msg5324
2009-11-24 20:16:44pjenveysetassignee: pjenvey
nosy: + pjenvey, cgroves
2009-11-13 13:21:41alex.gronholmcreate