Message5021
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. |
|
Date |
User |
Action |
Args |
2009-08-12 07:26:02 | alex.gronholm | set | recipients:
+ alex.gronholm, cgroves |
2009-08-12 07:26:01 | alex.gronholm | set | messageid: <1250061961.9.0.820814376554.issue1432@psf.upfronthosting.co.za> |
2009-08-12 07:26:01 | alex.gronholm | link | issue1432 messages |
2009-08-12 07:26:01 | alex.gronholm | create | |
|