Update of /cvsroot/jython/jython/org/python/modules
In directory usw-pr-cvs1:/tmp/cvs-serv22267/modules
Modified Files:
Setup.java
Added Files:
_jython.java
Log Message:
avoids isLazy hack.
introduces jython internal functs built-in module _jython (with is_lazy).
--- NEW FILE ---
package org.python.modules;
import org.python.core.*;
class JythonInternalFunctions extends PyBuiltinFunctionSet
{
public JythonInternalFunctions(String name, int index, int argcount) {
super(name, index, argcount, argcount, false, null);
}
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 argCountError(1);
}
}
}
public class _jython implements ClassDictInit
{
public static void classDictInit(PyObject dict) {
dict.__setitem__("is_lazy", new JythonInternalFunctions("is_lazy", 0, 1));
}
}
Index: Setup.java
===================================================================
RCS file: /cvsroot/jython/jython/org/python/modules/Setup.java,v
retrieving revision 2.13
retrieving revision 2.14
diff -C2 -r2.13 -r2.14
*** Setup.java 2000/12/23 14:03:50 2.13
--- Setup.java 2001/01/17 02:21:09 2.14
***************
*** 49,52 ****
--- 49,53 ----
"sha",
"ucnhash",
+ "_jython",
};
}
|