Message10689
Patching JavaProxyList.listRemoveOverrideProxy like this works for us:
private static final PyBuiltinMethodNarrow listRemoveOverrideProxy = new ListMethod("remove", 1) {
@Override
public PyObject __call__(PyObject object) {
List jlist = asList();
for (int i = 0; i < jlist.size(); i++) {
Object jobj = jlist.get(i);
if (Py.java2py(jobj)._eq(object).__nonzero__()) {
jlist.remove(i);
return Py.None;
}
}
// START PATCH FOR BUG 2456
if (object instanceof PyInteger) {
jlist.remove(((PyInteger)object).getValue());
return Py.None;
}
// END PATCH FOR BUG 2456
throw Py.ValueError(object.toString() + " is not in list");
}
};
It would be nice if such a change is incorporated in the library, as we consider this as another regression in Jython 2.7.0 with respect to Jython 2.5.2. |
|
Date |
User |
Action |
Args |
2016-02-02 09:42:59 | jsaiz | set | messageid: <1454406179.81.0.695148419683.issue2456@psf.upfronthosting.co.za> |
2016-02-02 09:42:59 | jsaiz | set | recipients:
+ jsaiz, zyasoft, babelmania |
2016-02-02 09:42:59 | jsaiz | link | issue2456 messages |
2016-02-02 09:42:59 | jsaiz | create | |
|