org.python.modules._jython Maven / Gradle / Ivy
Go to download
Jython is an implementation of the high-level, dynamic, object-oriented
language Python written in 100% Pure Java, and seamlessly integrated with
the Java platform. It thus allows you to run Python on any Java platform.
package org.python.modules;
import org.python.core.*;
class JythonInternalFunctions extends PyBuiltinFunctionSet
{
public JythonInternalFunctions(String name, int index, int argcount) {
super(name, index, argcount);
}
public PyObject __call__(PyObject arg) {
switch (index) {
case 0:
if (!(arg instanceof PyJavaClass))
throw Py.TypeError("is_lazy(): arg is not a jclass");
return Py.newBoolean(((PyJavaClass)arg).isLazy());
default:
throw info.unexpectedCall(1, false);
}
}
}
public class _jython implements ClassDictInit
{
public static void classDictInit(PyObject dict) {
dict.__setitem__("is_lazy",
new JythonInternalFunctions("is_lazy", 0, 1));
}
}