Пример #1
0
 public void __set__(PyObject obj, PyObject value) {
   PyType self_type = getType();
   PyObject impl = self_type.lookup("__set__");
   if (impl != null) {
     impl.__get__(this, self_type).__call__(obj, value);
     return;
   }
   super.__set__(obj, value);
 }
Пример #2
0
 public void __delitem__(PyObject key) { // ???
   PyType self_type = getType();
   PyObject impl = self_type.lookup("__delitem__");
   if (impl != null) {
     impl.__get__(this, self_type).__call__(key);
     return;
   }
   super.__delitem__(key);
 }
Пример #3
0
 public void __delattr__(String name) {
   PyType self_type = getType();
   PyObject impl = self_type.lookup("__delattr__");
   if (impl != null) {
     impl.__get__(this, self_type).__call__(PyString.fromInterned(name));
     return;
   }
   super.__delattr__(name);
 }
Пример #4
0
 public void __delslice__(PyObject start, PyObject stop, PyObject step) {
   if (step != null) {
     __delitem__(new PySlice(start, stop, step));
     return;
   }
   PyType self_type = getType();
   PyObject impl = self_type.lookup("__delslice__");
   if (impl != null) {
     PyObject[] indices = PySlice.indices2(this, start, stop);
     impl.__get__(this, self_type).__call__(indices[0], indices[1]);
     return;
   }
   super.__delslice__(start, stop, step);
 }