OLD | NEW |
1 /* Generated file, do not modify. See jython/src/templates/gderived.py. */ | 1 /* Generated file, do not modify. See jython/src/templates/gderived.py. */ |
2 package org.python.core; | 2 package org.python.core; |
3 | 3 |
4 public class PyComplexDerived extends PyComplex implements Slotted { | 4 public class PyComplexDerived extends PyComplex implements Slotted { |
5 | 5 |
6 public PyObject getSlot(int index) { | 6 public PyObject getSlot(int index) { |
7 return slots[index]; | 7 return slots[index]; |
8 } | 8 } |
9 | 9 |
10 public void setSlot(int index,PyObject value) { | 10 public void setSlot(int index,PyObject value) { |
(...skipping 1093 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1104 return this; | 1104 return this; |
1105 } | 1105 } |
1106 // Otherwise, we call the derived __tojava__, if it exists: | 1106 // Otherwise, we call the derived __tojava__, if it exists: |
1107 PyType self_type=getType(); | 1107 PyType self_type=getType(); |
1108 PyObject impl=self_type.lookup("__tojava__"); | 1108 PyObject impl=self_type.lookup("__tojava__"); |
1109 if (impl!=null) | 1109 if (impl!=null) |
1110 return impl.__get__(this,self_type).__call__(Py.java2py(c)).__tojava
__(Object.class); | 1110 return impl.__get__(this,self_type).__call__(Py.java2py(c)).__tojava
__(Object.class); |
1111 return super.__tojava__(c); | 1111 return super.__tojava__(c); |
1112 } | 1112 } |
1113 | 1113 |
| 1114 public Object __coerce_ex__(PyObject o) { |
| 1115 PyType self_type=getType(); |
| 1116 PyObject impl=self_type.lookup("__coerce__"); |
| 1117 if (impl!=null) { |
| 1118 PyObject res=impl.__get__(this,self_type).__call__(o); |
| 1119 if (res==null||res==Py.None) |
| 1120 return res; |
| 1121 if (!(res instanceof PyTuple)) |
| 1122 throw Py.TypeError("coercion should return None or 2-tuple"); |
| 1123 return((PyTuple)res).getArray(); |
| 1124 } |
| 1125 return super.__coerce_ex__(o); |
| 1126 } |
| 1127 |
1114 public String toString() { | 1128 public String toString() { |
1115 PyType self_type=getType(); | 1129 PyType self_type=getType(); |
1116 PyObject impl=self_type.lookup("__repr__"); | 1130 PyObject impl=self_type.lookup("__repr__"); |
1117 if (impl!=null) { | 1131 if (impl!=null) { |
1118 PyObject res=impl.__get__(this,self_type).__call__(); | 1132 PyObject res=impl.__get__(this,self_type).__call__(); |
1119 if (!(res instanceof PyString)) | 1133 if (!(res instanceof PyString)) |
1120 throw Py.TypeError("__repr__ returned non-string (type "+res.get
Type().fastGetName()+")"); | 1134 throw Py.TypeError("__repr__ returned non-string (type "+res.get
Type().fastGetName()+")"); |
1121 return((PyString)res).toString(); | 1135 return((PyString)res).toString(); |
1122 } | 1136 } |
1123 return super.toString(); | 1137 return super.toString(); |
1124 } | 1138 } |
1125 | 1139 |
1126 } | 1140 } |
OLD | NEW |