Message5021

Author alex.gronholm
Recipients alex.gronholm, cgroves
Date 2009-08-12.07:26:01
SpamBayes Score 7.118436e-08
Marked as misclassified No
Message-id <1250061961.9.0.820814376554.issue1432@psf.upfronthosting.co.za>
In-reply-to
Content
ITest.java:
-----------
public interface ITest {
    void testFunc();
}

Caller.java:
------------
public class Caller {
    public void testCall(ITest testObj) {
        testObj.testFunc();
    }
}

test.py:
--------
import ITest, Caller

class Implementor():
    def testFunc(self):
        print "works"

class PyClass1(ITest, Implementor):
    pass

class PyClass2(Implementor, ITest):
    pass

caller = Caller()
caller.testCall(PyClass1())
caller.testCall(PyClass2())


One would expect the same behavior from both classes, but only the
second call actually gets through and prints "works". The first call is
happily ignored -- no warnings, no errors, no nothing! I think the
interface's method declaration is somehow overwriting the one from
Implementor.
History
Date User Action Args
2009-08-12 07:26:02alex.gronholmsetrecipients: + alex.gronholm, cgroves
2009-08-12 07:26:01alex.gronholmsetmessageid: <1250061961.9.0.820814376554.issue1432@psf.upfronthosting.co.za>
2009-08-12 07:26:01alex.gronholmlinkissue1432 messages
2009-08-12 07:26:01alex.gronholmcreate