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); }
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); }
public void __delete__(PyObject obj) { PyType self_type = getType(); PyObject impl = self_type.lookup("__delete__"); if (impl != null) { impl.__get__(this, self_type).__call__(obj); return; } super.__delete__(obj); }
public void __setattr__(String name, PyObject value) { PyType self_type = getType(); PyObject impl = self_type.lookup("__setattr__"); if (impl != null) { impl.__get__(this, self_type).__call__(PyString.fromInterned(name), value); // CPython does not support instance-acquired finalizers. // So we don't check for __del__ here. return; } super.__setattr__(name, value); }
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); }