Index: src/org/python/core/PySliceDerived.java |
=================================================================== |
--- src/org/python/core/PySliceDerived.java (revisión: 5129) |
+++ src/org/python/core/PySliceDerived.java (copia de trabajo) |
@@ -1111,6 +1111,20 @@ |
return super.__tojava__(c); |
} |
+ public Object __coerce_ex__(PyObject o) { |
+ PyType self_type=getType(); |
+ PyObject impl=self_type.lookup("__coerce__"); |
+ if (impl!=null) { |
+ PyObject res=impl.__get__(this,self_type).__call__(o); |
+ if (res==null||res==Py.None) |
+ return res; |
+ if (!(res instanceof PyTuple)) |
+ throw Py.TypeError("coercion should return None or 2-tuple"); |
+ return((PyTuple)res).getArray(); |
+ } |
+ return super.__coerce_ex__(o); |
+ } |
+ |
public String toString() { |
PyType self_type=getType(); |
PyObject impl=self_type.lookup("__repr__"); |