private static void fill_classic_mro(List<PyObject> acc, PyClass classic_cl) { if (!acc.contains(classic_cl)) { acc.add(classic_cl); } PyObject[] bases = classic_cl.__bases__.getArray(); for (PyObject base : bases) { fill_classic_mro(acc,(PyClass)base); } }
/** * Initializes a {@link FunctionThread}, using the configured stack_size and * registering the thread in the @link {@link #group} of threads spawned by * the thread module. * * Also used from the threading.py module. */ public static FunctionThread _newFunctionThread(PyObject func, PyTuple args) { return new FunctionThread(func, args.getArray(), stack_size, group); }
PyObject lookup(String name) { PyObject result = __dict__.__finditem__(name); if (result == null && __bases__ != null) { for (PyObject base : __bases__.getArray()) { result = ((PyClass)base).lookup(name); if (result != null) { break; } } } return result; }
@Override public Object __coerce_ex__(PyObject o) { PyObject ret = invoke_ex("__coerce__", o); if (ret == null || ret == Py.None) return ret; if (!(ret instanceof PyTuple)) throw Py.TypeError("coercion should return None or 2-tuple"); return ((PyTuple) ret).getArray(); }
@ExposedSet(name = "__defaults__") public void setDefaults(PyObject func_defaults) { if (func_defaults != Py.None && !(func_defaults instanceof PyTuple)) { throw Py.TypeError("func_defaults must be set to a tuple object"); } this.__defaults__ = func_defaults == Py.None ? null : ((PyTuple)func_defaults).getArray(); }
public PyObject __iternext__() { PyObject args = nextElement(iterator); PyObject result = null; if (args != null) { PyTuple argTuple = PyTuple.fromIterable(args); // convert to array of PyObjects in call to function result = callable.__call__(argTuple.getArray()); } return result; }
@ExposedMethod(doc = BuiltinDocs.tuple___getnewargs___doc) final PyTuple tuple___getnewargs__() { return new PyTuple(new PyTuple(getArray())); }
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==Py.NotImplemented) return Py.None; if (!(res instanceof PyTuple)) throw Py.TypeError("__coerce__ didn't return a 2-tuple"); return((PyTuple)res).getArray(); } return super.__coerce_ex__(o); }
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==Py.NotImplemented) return Py.None; if (!(res instanceof PyTuple)) throw Py.TypeError("__coerce__ didn't return a 2-tuple"); return((PyTuple)res).getArray(); } return super.__coerce_ex__(o); }
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==Py.NotImplemented) return Py.None; if (!(res instanceof PyTuple)) throw Py.TypeError("__coerce__ didn't return a 2-tuple"); return((PyTuple)res).getArray(); } return super.__coerce_ex__(o); }
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==Py.NotImplemented) return Py.None; if (!(res instanceof PyTuple)) throw Py.TypeError("__coerce__ didn't return a 2-tuple"); return((PyTuple)res).getArray(); } return super.__coerce_ex__(o); }
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==Py.NotImplemented) return Py.None; if (!(res instanceof PyTuple)) throw Py.TypeError("__coerce__ didn't return a 2-tuple"); return((PyTuple)res).getArray(); } return super.__coerce_ex__(o); }
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==Py.NotImplemented) return Py.None; if (!(res instanceof PyTuple)) throw Py.TypeError("__coerce__ didn't return a 2-tuple"); return((PyTuple)res).getArray(); } return super.__coerce_ex__(o); }
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==Py.NotImplemented) return Py.None; if (!(res instanceof PyTuple)) throw Py.TypeError("__coerce__ didn't return a 2-tuple"); return((PyTuple)res).getArray(); } return super.__coerce_ex__(o); }
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==Py.NotImplemented) return Py.None; if (!(res instanceof PyTuple)) throw Py.TypeError("__coerce__ didn't return a 2-tuple"); return((PyTuple)res).getArray(); } return super.__coerce_ex__(o); }
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==Py.NotImplemented) return Py.None; if (!(res instanceof PyTuple)) throw Py.TypeError("__coerce__ didn't return a 2-tuple"); return((PyTuple)res).getArray(); } return super.__coerce_ex__(o); }
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==Py.NotImplemented) return Py.None; if (!(res instanceof PyTuple)) throw Py.TypeError("__coerce__ didn't return a 2-tuple"); return((PyTuple)res).getArray(); } return super.__coerce_ex__(o); }
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==Py.NotImplemented) return Py.None; if (!(res instanceof PyTuple)) throw Py.TypeError("__coerce__ didn't return a 2-tuple"); return((PyTuple)res).getArray(); } return super.__coerce_ex__(o); }
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==Py.NotImplemented) return Py.None; if (!(res instanceof PyTuple)) throw Py.TypeError("__coerce__ didn't return a 2-tuple"); return((PyTuple)res).getArray(); } return super.__coerce_ex__(o); }
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==Py.NotImplemented) return Py.None; if (!(res instanceof PyTuple)) throw Py.TypeError("__coerce__ didn't return a 2-tuple"); return((PyTuple)res).getArray(); } return super.__coerce_ex__(o); }