01: package org.python.modules;
02:
03: import org.python.core.*;
04:
05: class JythonInternalFunctions extends PyBuiltinFunctionSet {
06: public JythonInternalFunctions(String name, int index, int argcount) {
07: super (name, index, argcount);
08: }
09:
10: public PyObject __call__(PyObject arg) {
11: switch (index) {
12: case 0:
13: if (!(arg instanceof PyJavaClass))
14: throw Py.TypeError("is_lazy(): arg is not a jclass");
15: return Py.newBoolean(((PyJavaClass) arg).isLazy());
16: default:
17: throw info.unexpectedCall(1, false);
18: }
19: }
20: }
21:
22: public class _jython implements ClassDictInit {
23: public static void classDictInit(PyObject dict) {
24: dict.__setitem__("is_lazy", new JythonInternalFunctions(
25: "is_lazy", 0, 1));
26: }
27:
28: }
|