Index: src/org/python/core/PyJavaType.java =================================================================== --- src/org/python/core/PyJavaType.java (revision 6258) +++ src/org/python/core/PyJavaType.java (working copy) @@ -229,7 +229,33 @@ // returns just the public methods methods = forClass.getMethods(); } else { - methods = forClass.getDeclaredMethods(); + List classes = new ArrayList(); + //Firt collect all the classes from here to Object (in rev. order) + for (Class c = forClass; c != null; c=c.getSuperclass()) { + classes.add(0, c); + } + // Now we will walk down from object to our current class + // in the process maintain a map that maps method signature to + // methods. This should be pretty close (exact?) to the java + // method overriding rules. + Map sigMap = Generic.map(); + for (Class c : classes) { + for (Method m : c.getDeclaredMethods()) { + // Here we are building a string representation of the + // function name+signature + String sig = m.getName() +"("; + for (Class t : m.getParameterTypes()) { + // Not sure if this is exact enough ... if two types + // happened to have the same representation spit out by + // toString we would be messed up. Also, does this + // properly deal with generics?!? + sig += t.toString() + ','; + } + sigMap.put(sig, m); + } + } + + methods = sigMap.values().toArray(new Method[0]); for (Method method : methods) { method.setAccessible(true); }