Issue2101

classification
Title: Diamond-style multiple inheritance fails when using __slots__ on the second branch
Type: Severity: normal
Components: Core Versions: Jython 2.7
process
Status: open Resolution: remind
Dependencies: Superseder:
Assigned To: Nosy List: cdleonard, fwierzbicki, jeff.allen, zyasoft
Priority: normal Keywords:

Created on 2013-10-29.18:43:07 by cdleonard, last changed 2014-10-05.17:16:44 by zyasoft.

Messages
msg8164 (view) Author: Leonard Crestez (cdleonard) Date: 2013-10-29.18:43:06
First the sample code (ugly formatting for brevity):

class A(object):
    def method(self): pass

class B(A):
    __slots__ = ('b')
    def method(self):
        sys.stdout.write('B.method begin\n')
        super(B, self).method()
        self.b = 'b'

class C(A):
    def method(self):
        sys.stdout.write('C.method begin\n')
        super(C, self).method()
        self.c = 'c'

class D1(B, C):
    def method(self): super(D1, self).method()

class D2(C, B):
    def method(self): super(D2, self).method()

D1().method()
D2().method()

This works as expected in python. Output is the following:
B.method begin
C.method begin
C.method begin
B.method begin

On jython I get an exception when assigning to self.b under D2.method:
B.method begin
C.method begin
C.method begin
B.method begin
Traceback (most recent call last):
  File "jymulti.py", line 28, in <module>
    D2().method()
  File "jymulti.py", line 25, in method
    def method(self): super(D2, self).method()
  File "jymulti.py", line 18, in method
    super(C, self).method()
  File "jymulti.py", line 13, in method
    self.b = 'b'
java.lang.ArrayIndexOutOfBoundsException: 0
msg8172 (view) Author: Jeff Allen (jeff.allen) Date: 2013-11-01.23:57:37
#1996 likely same bug.
msg9081 (view) Author: Jim Baker (zyasoft) Date: 2014-10-05.17:16:18
Straightforward test for a complex problem
msg9082 (view) Author: Jim Baker (zyasoft) Date: 2014-10-05.17:16:44
Need to investigate for beta 4
History
Date User Action Args
2014-10-05 17:16:44zyasoftsetpriority: normal
messages: + msg9082
2014-10-05 17:16:18zyasoftsetresolution: remind
messages: + msg9081
nosy: + zyasoft
2013-11-01 23:57:37jeff.allensetnosy: + jeff.allen
messages: + msg8172
2013-10-29 20:06:00fwierzbickisetnosy: + fwierzbicki
2013-10-29 18:43:07cdleonardcreate