Message8164
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 |
|
Date |
User |
Action |
Args |
2013-10-29 18:43:08 | cdleonard | set | recipients:
+ cdleonard |
2013-10-29 18:43:08 | cdleonard | set | messageid: <1383072188.04.0.369915379656.issue2101@psf.upfronthosting.co.za> |
2013-10-29 18:43:07 | cdleonard | link | issue2101 messages |
2013-10-29 18:43:06 | cdleonard | create | |
|